body {
    background-color: #030303;
    color: #f5f5f5;
    overflow-x: hidden;
    cursor: none;
    /* Hide default cursor for custom one */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #030303;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00ff66;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #00ff66;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 255, 102, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9998;
    pointer-events: none;
    background-color: #00ff66;
}

.trail-1 {
    width: 6px;
    height: 6px;
    opacity: 0.6;
}

.trail-2 {
    width: 4px;
    height: 4px;
    opacity: 0.3;
}

.trail-3 {
    width: 2px;
    height: 2px;
    opacity: 0.15;
}

/* Outline expands on hoverable elements */
.cursor-hover {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 255, 102, 0.1);
    border-color: #00ff66;
}

/* Loader */
#loader {
    position: fixed;
    inset: 0;
    background-color: #030303;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #00ff66;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

.loader-text .char {
    transform: translateY(100%);
}

.char {
    display: inline-block;
}

/* Utilities */
.text-stroke {
    -webkit-text-stroke: 1px #333;
    color: transparent;
    transition: all 0.3s ease;
}

.text-stroke:hover {
    -webkit-text-stroke: 1px #00ff66;
    color: #00ff66;
    text-shadow: 0 0 20px rgba(0, 255, 102, 0.4);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #00ff66;
    transition: width 0.3s ease;
}

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

.project-card:hover .project-image {
    transform: scale(1.05) translateZ(20px);
    filter: grayscale(0%);
}

.project-image {
    filter: grayscale(100%);
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
    transform-style: preserve-3d;
}

.project-card {
    transform-style: preserve-3d;
    will-change: transform;
}

.floating-shape {
    transform-style: preserve-3d;
    will-change: transform;
}

/* --- Enhanced ID Card Physics & Styles --- */
.id-card-system {
    transform-style: preserve-3d;
    perspective: 1200px;
    transform-origin: top center;
    will-change: transform;
    user-select: none;
}

/* SVG Rope with Bezier Curves */
.lanyard-rope {
    position: relative;
    width: 40px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: repeating-linear-gradient(to bottom,
            #00ff66 0px,
            #00ff66 15px,
            #00cc52 15px,
            #00cc52 30px,
            #00ff66 30px,
            #00ff66 45px,
            #00cc52 45px,
            #00cc52 60px);
    border-radius: 20px;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.4);
}

.lanyard-rope svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.rope-path {
    fill: none;
    stroke: url(#rope-gradient);
    stroke-width: 12;
    stroke-linecap: round;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.lanyard-text {
    position: relative;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 1;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #003314;
    padding: 8px 0;
    max-width: 100%;
    overflow: hidden;
}

.id-badge {
    transform-style: preserve-3d;
    transition: box-shadow 0.3s ease;
}

.backface-hidden {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.rotate-y-180 {
    transform: rotateY(180deg);
}

/* --- Tic Tac Toe Mini Game --- */
.tic-cell.tic-x {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tic-cell.tic-o {
    color: #00ff66;
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.5);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tic-cell.tic-win {
    background-color: rgba(0, 255, 102, 0.2);
    border-color: rgba(0, 255, 102, 0.5);
    animation: winPulse 1.5s infinite;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes winPulse {
    0% {
        box-shadow: 0 0 0px rgba(0, 255, 102, 0);
    }

    50% {
        box-shadow: 0 0 15px rgba(0, 255, 102, 0.3);
    }

    100% {
        box-shadow: 0 0 0px rgba(0, 255, 102, 0);
    }
}

.badge-glare {
    background: linear-gradient(105deg,
            transparent 20%,
            rgba(255, 255, 255, 0.4) 25%,
            rgba(255, 255, 255, 0.8) 28%,
            transparent 32%);
    background-size: 200% 200%;
    background-position: 100% 100%;
    mix-blend-mode: overlay;
    border-radius: inherit;
}

.badge-crease {
    background: linear-gradient(to bottom,
            transparent 49%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(0, 0, 0, 0.05) 51%,
            transparent 52%);
    pointer-events: none;
}

/* Dragging State */
.id-card-system.dragging {
    cursor: grabbing !important;
}

.id-card-system.dragging .id-badge {
    box-shadow:
        0 35px 70px -12px rgba(0, 0, 0, 0.9),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 2px 15px rgba(255, 255, 255, 0.6);
}

/* Ensure cursor is default on touch devices */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }

    .cursor-dot,
    .cursor-outline {
        display: none;
    }
}

/* --- Premium Background Effects --- */
.noise-overlay {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
}

.bg-spotlight {
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(0, 255, 102, 0.06) 0%,
            rgba(0, 0, 0, 0) 50%);
    will-change: background;
}

/* --- Magnetic Button --- */
.magnetic-btn {
    transition: transform 0.1s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s, border-color 0.3s;
    will-change: transform;
}

.magnetic-btn span,
.magnetic-btn div {
    pointer-events: none;
}

/* --- Text Stroke Hover Effect --- */
.hover\:text-stroke-hover:hover {
    -webkit-text-stroke: 1px #00ff66;
    color: #00ff66;
    text-shadow: 0 0 30px rgba(0, 255, 102, 0.6);
}

/* --- AI Chat Interface Styles --- */

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-in.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-in.zoom-in {
    animation: zoomIn 0.3s ease-out forwards;
}

/* Scrollbar for chat */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 102, 0.5);
}

/* Typing Indicator */
.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #00ff66;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Markdown-like Styles in Chat */
#chat-messages p {
    margin-bottom: 0.5rem;
}

#chat-messages p:last-child {
    margin-bottom: 0;
}

#chat-messages code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 0.2em;
    font-family: monospace;
    font-size: 0.9em;
    color: #00ff66;
}

/* --- Expertise Card Enhancements --- */
.expertise-card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
}

.expertise-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.expertise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 102, 0.05), transparent);
    transition: left 0.5s ease;
}

/* --- AI Avatar 3D Animation --- */
.perspective-1000 {
    perspective: 1000px;
}

.transform-style-3d {
    transform-style: preserve-3d;
}


/* --- Motion Graphics / Glitch Effect --- */
.avatar-layer.base {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.avatar-wrapper:hover .avatar-layer.base {
    filter: display-mode(3px);
    /* Subtle blur shift */
}

.group:hover .avatar-layer.glitch-1 {
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.group:hover .avatar-layer.glitch-2 {
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
        transform: translate(-2px, 1px);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
        transform: translate(2px, -1px);
    }

    40% {
        clip-path: inset(40% 0 50% 0);
        transform: translate(-2px, 2px);
    }

    60% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(2px, -2px);
    }

    80% {
        clip-path: inset(10% 0 70% 0);
        transform: translate(-1px, 1px);
    }

    100% {
        clip-path: inset(30% 0 20% 0);
        transform: translate(1px, -1px);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(2px, -1px);
    }

    20% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(-2px, 1px);
    }

    40% {
        clip-path: inset(30% 0 20% 0);
        transform: translate(2px, 2px);
    }

    60% {
        clip-path: inset(15% 0 80% 0);
        transform: translate(-1px, -2px);
    }

    80% {
        clip-path: inset(55% 0 10% 0);
        transform: translate(1px, 1px);
    }

    100% {
        clip-path: inset(40% 0 30% 0);
        transform: translate(-2px, -1px);
    }
}

@keyframes scan-line {
    0% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.animate-scan {
    animation: scan-line 2s linear infinite;
}

.speech-bubble {
    animation: floatBubble 2s ease-in-out infinite alternate;
}

/* ============================================
   EXPERTISE SECTION ENHANCEMENTS
   ============================================ */

/* 3D Tilt Effect */
.expertise-card {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.6s ease;
    will-change: transform;
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg, rgba(12, 12, 12, 0.9) 0%, rgba(12, 12, 12, 0.7) 100%);
    position: relative;
    z-index: 1;
}

.expertise-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 255, 102, 0.2),
        0 0 40px rgba(0, 255, 102, 0.1),
        inset 0 0 60px rgba(0, 255, 102, 0.05);
}

/* Animated Gradient Border */
.expertise-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg,
            transparent 0%,
            rgba(0, 255, 102, 0.3) 25%,
            transparent 50%,
            rgba(0, 255, 102, 0.3) 75%,
            transparent 100%);
    background-size: 300% 300%;
    border-radius: 1.5rem;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s ease;
    animation: gradientShift 8s ease infinite;
}

.expertise-card:hover::before {
    opacity: 1;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Icon Animations */
.expertise-card i {
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55),
        filter 0.5s ease;
    display: inline-block;
}

.expertise-card:hover i {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 0 20px rgba(0, 255, 102, 0.8));
}

/* Progress Bar Animation */
.expertise-card .bg-brand-green {
    width: 0 !important;
    transition: width 1.5s cubic-bezier(0.65, 0, 0.35, 1);
    position: relative;
    overflow: hidden;
}

.expertise-card .bg-brand-green::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Particle Background for Expertise Section */
#expertise::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 255, 102, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 102, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* Floating Particles */
#expertise::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(0, 255, 102, 0.1) 1px, transparent 1px);
    background-size: 100px 100px;
    animation: particleFloat 15s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.3;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Tags/Chips Hover Effect */
.expertise-card span[class*="px-"] {
    transition: all 0.3s ease;
}

.expertise-card:hover span[class*="px-"] {
    background: rgba(0, 255, 102, 0.1);
    border-color: rgba(0, 255, 102, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 102, 0.2);
}

/* Inner Glow on Hover */
.expertise-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(0, 255, 102, 0.1) 0%,
            transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.expertise-card:hover::after {
    opacity: 1;
}

.expertise-card>* {
    position: relative;
    z-index: 1;
}

@keyframes floatBubble {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}