/* Custom CSS */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;600;700&display=swap');

:root {
    --primary: #8b5cf6;
    --secondary: #14b8a6;
    --bento-bg: rgba(255, 255, 255, 0.6);
    /* Nền sáng */
    --bento-border: rgba(0, 0, 0, 0.08);
    /* Viền sáng */
    --bento-hover-border: rgba(0, 0, 0, 0.2);
    --bg-grid-color: rgba(0, 0, 0, 0.05);
    /* Lưới sáng */
}

/* CSS variables khi bật Dark Mode */
html.dark {
    --bento-bg: rgba(255, 255, 255, 0.02);
    --bento-border: rgba(255, 255, 255, 0.05);
    --bento-hover-border: rgba(255, 255, 255, 0.15);
    --bg-grid-color: rgba(255, 255, 255, 0.03);
}

body {
    overflow-x: hidden;
}

@media (min-width: 768px) {
    body {
        cursor: none;
    }
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: var(--secondary);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.custom-cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(20, 184, 166, 0.5);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9998;
    transition: width 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        height 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        background-color 0.3s;
}

.custom-cursor-follower.hovering {
    width: 60px;
    height: 60px;
    background-color: rgba(20, 184, 166, 0.1);
    border-color: var(--secondary);
}

/* Bento Box Glowing Effect */
.bento-card {
    position: relative;
    background: var(--bento-bg);
    border: 1px solid var(--bento-border);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: transform 0.4s ease, background 0.3s ease, border-color 0.3s ease;
    backdrop-filter: blur(8px);
}

.bento-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(600px circle at var(--mouse-x, 0) var(--mouse-y, 0),
            rgba(139, 92, 246, 0.15),
            transparent 40%);
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

.bento-card:hover {
    transform: translateY(-8px);
    border-color: var(--bento-hover-border);
}

.bento-content {
    position: relative;
    z-index: 1;
}

/* Typewriter */
.typewriter-container {
    display: inline-block;
}

.typewriter {
    overflow: hidden;
    border-right: 0.15em solid var(--secondary);
    white-space: nowrap;
    margin: 0 auto;
    animation:
        typing 2s steps(20, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--secondary);
    }
}

/* Background Grid Pattern */
.bg-grid {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, var(--bg-grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--bg-grid-color) 1px, transparent 1px);
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}