:root {
    --primary-color: #ffffff;
    --secondary-color: #a0a0a0;
    --accent-color: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.75);
    --card-bg: rgba(15, 15, 15, 0.6);
    --card-border: rgba(255, 255, 255, 0.1);
    --blur-amount: 15px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-y: auto;
    height: -webkit-fill-available;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--primary-color);
    background-color: #000;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    overflow-y: auto;
    /* Allow vertical scroll */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    cursor: none;
}

/* Background Media */
.background-media {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    /* Increased visibility */
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.1) 50%,
            rgba(0, 0, 0, 0.1));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
    /* Reduced intensity for clarity */
}

/* Click to Enter Overlay */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.5s ease-in-out;
}

/* Headlights Animation Structure */
.headlights {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 300px;
    opacity: 0;
    transition: opacity 0.1s;
}

.light {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, #a3cfff, transparent 70%);
    box-shadow: 0 0 50px #fff, 0 0 100px #6b96c9;
    filter: blur(10px);
    transform: scale(0);
}

.headlights.on {
    opacity: 1;
}

.headlights.on .light {
    animation: ignition 1.5s forwards;
}

@keyframes ignition {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    5% {
        transform: scale(1.2);
        opacity: 1;
    }

    10% {
        transform: scale(1);
        opacity: 0.8;
    }

    15% {
        transform: scale(1.3);
        opacity: 1;
        filter: brightness(2);
    }

    20% {
        transform: scale(1);
        opacity: 0.9;
    }

    25% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }

    /* Fade out after flash */
}

/* HID Flicker Effect */
.light {
    animation: hid-flicker 0.4s ease-out forwards;
}

@keyframes hid-flicker {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    30% {
        opacity: 1;
        transform: scale(1.2);
    }

    40% {
        opacity: 0.5;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }

    60% {
        opacity: 0.7;
        transform: scale(1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rumble/Shake Effect */
.startup-shake {
    animation: rumble 0.1s infinite;
}

@keyframes rumble {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(2px, 2px);
    }

    50% {
        transform: translate(-2px, -2px);
    }

    75% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(-2px, 2px);
    }
}

/* Speed Lines */
.speed-lines {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(45deg,
            transparent 0,
            transparent 10%,
            rgba(255, 255, 255, 0.05) 10%,
            rgba(255, 255, 255, 0.05) 11%);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 1001;
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.speed-lines.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: speed-warp 0.5s linear infinite;
}

@keyframes speed-warp {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2) rotate(2deg);
    }
}

/* M Logo Loader */
.m-logo-loader {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    justify-content: center;
}

.m-logo-loader span {
    display: block;
    width: 15px;
    height: 40px;
    transform: skewX(-20deg);
    opacity: 0.5;
    transition: all 0.3s;
}

.m-logo-loader span:nth-child(1) {
    background: #6b96c9;
}

.m-logo-loader span:nth-child(2) {
    background: #12247f;
}

.m-logo-loader span:nth-child(3) {
    background: #dd0000;
}

#overlay:hover .m-logo-loader span {
    opacity: 1;
    box-shadow: 0 0 15px currentColor;
}

#start-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 4px;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.6;
        text-shadow: 0 0 0px transparent;
    }

    to {
        opacity: 1;
        text-shadow: 0 0 20px #fff;
    }
}

.mobile-notice {
    display: none;
    font-size: 0.7rem;
    color: #dd0000;
    margin-top: 10px;
    letter-spacing: 1px;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(221, 0, 0, 0.5);
}

/* Main Container */
.container {
    opacity: 1;
    transition: opacity 1s ease;
    width: 100%;
    max-width: 450px;
    /* Default for mobile */
    padding: 20px;
    perspective: 1000px;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Custom Cursor - CSS BMW Wheel (Reliable) */
/* Custom Cursor - BMW Wheel SVG */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;

    background-image: url('assets/wheel.svg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;

    /* Glow for effect */
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));

    transition: width 0.2s, height 0.2s;
    will-change: transform;
}

.custom-cursor.hover {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 0 8px #dd0000);
    /* Red Glow */
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    display: none;
    /* Disable glitch layers */
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(20px, 9999px, 80px, 0);
    }

    20% {
        clip: rect(60px, 9999px, 10px, 0);
    }

    40% {
        clip: rect(85px, 9999px, 120px, 0);
    }

    60% {
        clip: rect(10px, 9999px, 50px, 0);
    }

    80% {
        clip: rect(35px, 9999px, 90px, 0);
    }

    100% {
        clip: rect(70px, 9999px, 30px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(40px, 9999px, 15px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 60px, 0);
    }

    60% {
        clip: rect(90px, 9999px, 40px, 0);
    }

    80% {
        clip: rect(20px, 9999px, 80px, 0);
    }

    100% {
        clip: rect(50px, 9999px, 10px, 0);
    }
}

/* Profile Card with RGB Border */
.profile-card {
    position: relative;
    /* Border removed for clear view */
    background: rgba(0, 0, 0, 0.2);
    /* Clearer background */
    backdrop-filter: blur(5px);
    /* Reduced blur */
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Very subtle border */
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    /* Reduced shadow */
    transform-style: preserve-3d;
    animation: cardFloat 6s ease-in-out infinite;
    z-index: 1;

    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
    /* For border beam */
}

/* Border Beam Effect */
.profile-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: conic-gradient(transparent 0deg,
            transparent 150deg,
            #6b96c9 210deg,
            /* BMW Light Blue */
            #ffffff 240deg,
            /* White */
            #12247f 270deg,
            /* BMW Dark Blue */
            #dd0000 330deg,
            /* BMW Red */
            transparent 360deg);
    animation: rotate-beam 6s linear infinite;
    z-index: -1;
    pointer-events: none;
    will-change: transform;
    /* translate moves to keyframes to prevent overwrite */
}

.profile-card::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: rgba(10, 10, 10, 0.85);
    border-radius: 18px;
    z-index: -1;
    backdrop-filter: blur(15px);
}

@keyframes rotate-beam {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes animateBefore {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 300% 0;
    }
}

@keyframes cardFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Layout Sections */
.card-left,
.card-right {
    width: 100%;
}

/* Profile Picture */
.pfp-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.pfp {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    transition: transform 0.5s ease;
}

.pfp:hover {
    transform: scale(1.05) rotate(5deg);
}

.status-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: #23a559;
    /* Online status */
    border-radius: 50%;
    border: 3px solid rgba(20, 20, 20, 0.8);
    box-shadow: 0 0 10px #23a559;
}

/* Badges */
.badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    color: var(--secondary-color);
    transition: all 0.3s;
    cursor: default;
}

.badge:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Typography */
@keyframes textSparkle {
    0% {
        opacity: 0.8;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.6);
    }

    100% {
        opacity: 0.8;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    }
}

.username {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(110deg,
            #fff 20%,
            #6b96c9 45%,
            #6b96c9 55%,
            #fff 80%);
    background-size: 200% auto;
    color: #000;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
    /* Smoother speed */
    will-change: background-position;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.typing-container {
    height: 24px;
    margin-bottom: 25px;
    color: var(--secondary-color);
    font-size: 0.95rem;
    font-weight: 300;
}

.cursor {
    display: inline-block;
    width: 2px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Links */
.links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.link-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.link-item i {
    font-size: 1.2rem;
}

.custom-icon {
    width: 1.5rem;
    /* Little bit bigger */
    height: 1.5rem;
    object-fit: contain;
    filter: brightness(0) invert(1);
    /* Forces any color to White */
    transition: transform 0.3s;
}

.link-item:hover .custom-icon {
    transform: scale(1.1);
}



/* Responsive & Desktop Transformation */
@media (min-width: 768px) {
    .container {
        max-width: 900px;
    }

    .profile-card {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 40px;
        padding: 50px;
    }

    .card-left {
        width: 40%;
        display: flex;
        flex-direction: column;
        align-items: center;
        /* Keep identity centered in its column or left? usually centered looks good */
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        padding-right: 30px;
    }

    .card-right {
        width: 60%;
        padding-left: 10px;
    }

    /* Adjust specific elements for desktop layout if needed */
    .pfp-container {
        margin: 0 auto 20px;
        /* Keep centered in left col */
    }

    /* Make links grid on desktop? Or keep list? List is fine. */
    .links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* Two columns of links on desktop */
        gap: 15px;
    }

    .views {
        margin-top: auto;
        /* Push to bottom */
        padding-top: 20px;
    }
}

@media (max-width: 480px) {
    .profile-card {
        padding: 30px 15px;
        gap: 15px;
    }

    .username {
        font-size: 1.6rem;
        /* Slightly smaller for mobile */
        letter-spacing: 1px;
    }

    .typing-container {
        font-size: 0.85rem;
        height: 20px;
        margin-bottom: 15px;
    }

    .links {
        gap: 10px;
    }

    .link-item {
        padding: 10px;
        font-size: 0.9rem;
    }

    .mobile-notice {
        display: block;
        /* Show notice on mobile */
    }

    /* Hide custom cursor on mobile */
    .custom-cursor {
        display: none !important;
    }

    body {
        cursor: auto;
    }
}

@keyframes zoomIn {
    0% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Staggered Entrances */
.stagger-in {
    opacity: 0;
    transform: translateY(20px);
}

.main-content-active .stagger-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-in:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-in:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-in:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-in:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-in:nth-child(5) {
    animation-delay: 0.5s;
}

/* Link Hover Enhanced */
.link-item {
    position: relative;
    overflow: hidden;
}

.link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: 0.5s;
}

.link-item:hover::before {
    left: 100%;
}

.link-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #6b96c9;
    box-shadow: 0 0 20px rgba(107, 150, 201, 0.3);
}

/* Particle Style */
.particle {
    position: fixed;
    pointer-events: none;
    background: #fff;
    border-radius: 50%;
    z-index: -1;
    will-change: transform, opacity;
}