/* ===== GLOBAL STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700;800&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

* {
    cursor: none !important;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: #F3F4F6;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ===== MAGNETIC CUSTOM CURSOR ===== */
.custom-cursor {
    width: 30px;
    height: 30px;
    background: #CCFF00;
    border: 3px solid #000000;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.3s, height 0.3s, background 0.3s;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
}

.custom-cursor.expanded {
    width: 60px;
    height: 60px;
    background: #0066FF;
    mix-blend-mode: normal;
    opacity: 0.8;
}

.custom-cursor-dot {
    width: 6px;
    height: 6px;
    background: #000000;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
}

/* ===== TERMINAL STYLES ===== */
.terminal-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90vw;
    height: 450px;
    max-height: 80vh;
    background: #0a0a0a;
    border: 3px solid #000000;
    box-shadow: 12px 12px 0px 0px rgba(0,0,0,1);
    z-index: 1000;
    display: none;
    resize: both;
    overflow: auto;
    min-width: 300px;
    min-height: 200px;
}

.terminal-window.active {
    display: block;
}

.terminal-header {
    background: #CCFF00;
    padding: 10px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #000000;
    user-select: none;
}

.terminal-body {
    position: relative;
    height: calc(100% - 50px);
    overflow-y: auto;
}

#matrixCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    pointer-events: none;
}

.terminal-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    color: #00ff41;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

#terminalInput {
    background: transparent;
    border: none;
    color: #00ff41;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    outline: none;
    flex: 1;
    caret-color: #CCFF00;
}

/* ===== PHYSICS SANDBOX ===== */
.physics-sandbox {
    position: relative;
    width: 100%;
    min-height: 300px;
    border: 3px solid #000000;
    box-shadow: 8px 8px 0px 0px rgba(0,0,0,1);
    background: #FFFFFF;
    overflow: hidden;
    cursor: grab;
}

.physics-sandbox:active {
    cursor: grabbing;
}

.physics-tag {
    position: absolute;
    padding: 10px 20px;
    background: #CCFF00;
    border: 3px solid #000000;
    box-shadow: 4px 4px 0px 0px rgba(0,0,0,1);
    font-weight: 700;
    font-size: 16px;
    cursor: grab;
    user-select: none;
    white-space: nowrap;
    transition: transform 0.1s;
    will-change: transform;
}

.physics-tag:active {
    cursor: grabbing;
    box-shadow: 2px 2px 0px 0px rgba(0,0,0,1);
    transform: scale(0.95);
}

/* ===== BENTO GRID 3D TILT ===== */
.bento-card {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.bento-card:hover {
    transform: rotateX(5deg) rotateY(5deg) scale(1.02);
}

/* ===== PROJECT CARDS ===== */
.project-card {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: visible;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.05);
    z-index: 10;
    box-shadow: 16px 16px 0px 0px rgba(0,0,0,1);
}

.project-card:hover .project-image {
    transform: scale(1.1) rotate(-2deg);
    border: 3px solid #CCFF00;
}

.project-image {
    transition: all 0.4s ease;
    height: 200px;
    background-size: cover;
    background-position: center;
    border: 3px solid #000000;
}

/* ===== GLITCH EFFECT ===== */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.glitch-hover:hover .glitch-element {
    animation: glitch 0.3s ease infinite;
}

.glitch-hover:hover .glitch-element::before,
.glitch-hover:hover .glitch-element::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-hover:hover .glitch-element::before {
    color: #0066FF;
    animation: glitch 0.3s ease infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(-2px, -2px);
}

.glitch-hover:hover .glitch-element::after {
    color: #CCFF00;
    animation: glitch 0.3s ease infinite reverse;
    clip-path: polygon(0 80%, 100% 20%, 100% 100%, 0 100%);
    transform: translate(2px, 2px);
}

/* ===== COUNTER ANIMATION ===== */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.counter-digit {
    display: inline-block;
    animation: countUp 0.5s ease forwards;
    opacity: 0;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    .terminal-window {
        width: 95vw;
        height: 60vh;
        max-height: 70vh;
    }
    
    .physics-sandbox {
        min-height: 250px;
    }
    
    .physics-tag {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    .bento-card:hover {
        transform: rotateX(2deg) rotateY(2deg) scale(1.01);
    }
    
    .project-card:hover {
        transform: translateY(-5px) scale(1.02);
    }
}

/* ===== SCROLL ANIMATIONS ===== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== FORM STYLES ===== */
.invoice-form {
    background: #FFFFFF;
    border: 3px solid #000000;
    box-shadow: 12px 12px 0px 0px rgba(0,0,0,1);
    position: relative;
}

.invoice-form::before {
    content: 'CONTACT US';
    position: absolute;
    top: -15px;
    right: 20px;
    background: #CCFF00;
    padding: 5px 15px;
    border: 3px solid #000000;
    font-weight: 700;
    font-size: 14px;
    transform: rotate(2deg);
}

.form-input {
    border: 3px solid #000000;
    padding: 12px 16px;
    font-size: 16px;
    background: #F3F4F6;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    background: #FFFFFF;
    box-shadow: 4px 4px 0px 0px #CCFF00;
    transform: translate(-2px, -2px);
}
