:root {
    --bg-dark: #030b25;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent: #0088ff;
    --accent-glow: rgba(0, 136, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Custom V cursor */
    /* Hardware acceleration for smoother rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Custom Cursor */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    mix-blend-mode: difference;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    /* Use will-change to optimize GPU rendering for cursor */
    will-change: transform;
}

/* Start Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 4, 16, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}

.overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.start-content h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 4px;
    color: var(--text-secondary);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Container & 3D Environment */
.container {
    perspective: 1500px;
    z-index: 10;
    width: 100%;
    max-width: 950px; /* Made even wider so text fits perfectly */
    padding: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1), transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 3D Glass Card WOW Effect - Restored to Rectangle */
.glass-card {
    background: rgba(10, 15, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 136, 255, 0.2);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    will-change: transform;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Holographic Glare for WOW effect */
.glare {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.15) 0%, transparent 60%);
}

/* Parallax Inner Content */
.card-content {
    transform: translateZ(50px);
    transform-style: preserve-3d;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-img {
    width: 85px; /* Fits perfectly at the top */
    height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(0, 136, 255, 0.8)); /* Bloom for logo */
    transform: translateZ(30px);
    animation: float 6s infinite ease-in-out;
}

/* Illuminati Eye in the middle card */
.illuminati-eye {
    width: 60px;
    height: 60px;
    margin-bottom: 5px;
    transform: translateZ(50px);
    filter: drop-shadow(0 0 25px rgba(0, 136, 255, 1));
    animation: pulseEye 2s infinite alternate, floatEye 3s infinite ease-in-out;
}

/* Floating Capstone Line */
.capstone-line {
    width: 140px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 136, 255, 1), transparent);
    margin: 15px auto 25px auto;
    transform: translateZ(40px);
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.9);
}

@keyframes pulseEye {
    0% { transform: translateZ(50px) scale(1); opacity: 0.8; }
    100% { transform: translateZ(50px) scale(1.1); opacity: 1; }
}

@keyframes floatEye {
    0% { transform: translateZ(50px) translateY(0px); }
    50% { transform: translateZ(50px) translateY(-5px); }
    100% { transform: translateZ(50px) translateY(0px); }
}

.title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 5px;
    transform: translateZ(40px);
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: -1px;
    transition: text-shadow 0.2s, transform 0.2s;
}

/* Hacker Glitch Effect on Hover */
.title:hover {
    text-shadow: 
        3px 0 0 rgba(255,0,0,0.8), 
        -3px 0 0 rgba(0,136,255,0.8);
    animation: simple-glitch 0.2s infinite;
}

@keyframes simple-glitch {
    0% { transform: translateZ(40px) translate(0) }
    20% { transform: translateZ(40px) translate(-2px, 1px) }
    40% { transform: translateZ(40px) translate(2px, -1px) }
    60% { transform: translateZ(40px) translate(-2px, 2px) }
    80% { transform: translateZ(40px) translate(2px, -2px) }
    100% { transform: translateZ(40px) translate(0) }
}

.subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 25px;
    transform: translateZ(30px);
    max-width: 450px;
    word-wrap: break-word;
}

.about-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 auto 30px auto;
    max-width: 440px; /* Perfect width for the lower triangle section */
    transform: translateZ(20px);
    padding: 0 10px;
}

.about-text strong {
    color: #fff;
    font-weight: 600;
}

/* Skills Tags */
.skills-title {
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 15px;
    transform: translateZ(20px);
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 460px; /* Keep tags centered and contained */
    margin: 0 auto;
    transform: translateZ(30px);
}

.tag {
    background: rgba(0, 136, 255, 0.1);
    border: 1px solid rgba(0, 136, 255, 0.3);
    color: #87bfff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 136, 255, 0);
}

.tag:hover {
    background: rgba(0, 136, 255, 0.3);
    border-color: rgba(0, 136, 255, 0.8);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.5);
    transform: translateY(-2px);
}

/* --- 3D CSS PISTOL ENGINE --- */
.css-3d-gun-container {
    position: absolute;
    bottom: -150px; /* Under the glass card */
    left: 50%;
    transform: translateX(-50%) translateZ(60px);
    width: 200px;
    height: 150px;
    perspective: 1200px;
    z-index: 20;
    pointer-events: none;
}

.css-3d-gun {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: rotateGun 8s infinite linear;
}

@keyframes rotateGun {
    0% { transform: rotateY(0deg) rotateX(-5deg) translateY(0px); }
    50% { transform: rotateY(180deg) rotateX(-15deg) translateY(-15px); }
    100% { transform: rotateY(360deg) rotateX(-5deg) translateY(0px); }
}

/* Base Cuboid Logic */
.cuboid {
    position: absolute;
    transform-style: preserve-3d;
}
.cuboid .face {
    position: absolute;
    border: 1px solid rgba(0, 136, 255, 0.5);
    background: rgba(5, 10, 20, 0.9);
    box-shadow: inset 0 0 15px rgba(0, 136, 255, 0.2);
}

/* 1. Barrel (Top Slide) */
.barrel {
    top: 20px; left: 10px;
    width: 180px; height: 35px;
    transform: translateZ(10px);
}
.barrel .front  { width: 180px; height: 35px; transform: rotateY(0deg) translateZ(12px); }
.barrel .back   { width: 180px; height: 35px; transform: rotateY(180deg) translateZ(12px); }
.barrel .right  { width: 24px;  height: 35px; transform: rotateY(90deg) translateZ(168px); }
.barrel .left   { width: 24px;  height: 35px; transform: rotateY(-90deg) translateZ(12px); }
.barrel .top    { width: 180px; height: 24px; transform: rotateX(90deg) translateZ(12px); }
.barrel .bottom { width: 180px; height: 24px; transform: rotateX(-90deg) translateZ(23px); }

/* Neon Accents on Barrel */
.barrel .left, .barrel .right {
    background: rgba(0, 136, 255, 0.8);
    box-shadow: 0 0 20px rgba(0, 136, 255, 1);
    border-color: #fff;
}

/* 2. Grip (Handle) */
.grip {
    top: 55px; left: 20px;
    width: 45px; height: 100px;
    transform: rotateZ(-18deg) translateZ(10px);
    transform-origin: top center;
}
.grip .front  { width: 45px; height: 100px; transform: rotateY(0deg) translateZ(10px); }
.grip .back   { width: 45px; height: 100px; transform: rotateY(180deg) translateZ(10px); }
.grip .right  { width: 20px; height: 100px; transform: rotateY(90deg) translateZ(35px); }
.grip .left   { width: 20px; height: 100px; transform: rotateY(-90deg) translateZ(10px); }
.grip .top    { width: 45px; height: 20px; transform: rotateX(90deg) translateZ(10px); }
.grip .bottom { width: 45px; height: 20px; transform: rotateX(-90deg) translateZ(90px); background: rgba(0, 136, 255, 0.9); box-shadow: 0 5px 20px rgba(0,136,255,1); }

/* 3. Trigger Guard */
.trigger-guard {
    top: 55px; left: 75px;
    width: 35px; height: 30px;
    transform: translateZ(10px);
}
.trigger-guard .face {
    background: transparent;
    border: 3px solid rgba(0, 136, 255, 0.6);
    box-shadow: none;
}
.trigger-guard .front  { width: 35px; height: 30px; transform: rotateY(0deg) translateZ(5px); border-top: none; }
.trigger-guard .back   { width: 35px; height: 30px; transform: rotateY(180deg) translateZ(5px); border-top: none; }
.trigger-guard .right  { width: 10px; height: 30px; transform: rotateY(90deg) translateZ(30px); }
.trigger-guard .left   { width: 10px; height: 30px; transform: rotateY(-90deg) translateZ(5px); }
.trigger-guard .top    { width: 35px; height: 10px; transform: rotateX(90deg) translateZ(5px); border: none; }
.trigger-guard .bottom { width: 35px; height: 10px; transform: rotateX(-90deg) translateZ(25px); }


@keyframes float {
    0%, 100% { transform: translateZ(30px) translateY(0); }
    50% { transform: translateZ(30px) translateY(-10px); }
}

/* Audio Visualizer */
#visualizer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

#visualizer.visible {
    opacity: 0.4;
}

/* MOBILE OPTIMIZATIONS for No-Lag & Responsive Design */
@media (max-width: 768px) {
    * {
        cursor: auto !important; /* Enable native cursor on touch */
    }
    .cursor {
        display: none !important; /* Hide custom cursor on mobile to save performance */
    }
    .glass-card {
        padding: 30px 20px;
        /* Disable complex 3D tilt on mobile for performance */
        transform: none !important;
        transition: none;
        animation: mobileFloat 6s infinite ease-in-out;
    }
    .card-content, .logo-img, .title, .subtitle, .about-text, .skills-title, .skills-tags {
        transform: none !important; /* Flatten on mobile for max FPS */
    }
    
    @keyframes mobileFloat {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-8px); }
    }

    .title { font-size: 2.8rem; }
    .subtitle { font-size: 0.9rem; letter-spacing: 2px; }
    .about-text { font-size: 0.95rem; }
    .logo-img { width: 90px; }
    .tag { font-size: 0.75rem; padding: 5px 12px; }
}
