/* ASCII Geometry Animation */

#ascii-canvas {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(calc(var(--cursor-x, -100px) - 50%), calc(var(--cursor-y, -100px) - 50%));
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 1.4s ease;
    user-select: none;
    overflow: hidden;
    will-change: transform;
}

#ascii-canvas.is-visible {
    opacity: 1; /* Maximum visibility */
}

#ascii-canvas pre {
    font-family: 'DM Mono', 'Courier New', monospace;
    font-size: 6px; /* Smaller for cursor */
    font-weight: bold; /* Make characters thicker and brighter */
    line-height: 1.25;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    white-space: pre;
    margin: 0;
    padding: 0;
    /* Double-layered glow for maximum brightness */
    text-shadow: 0 0 8px var(--color-accent), 0 0 20px color-mix(in srgb, var(--color-accent) 60%, transparent);
}

/* Paused when user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    #ascii-canvas {
        display: none;
    }
}

/* On mobile: fixed accent instead of cursor */
@media (max-width: 810px) {
    #ascii-canvas {
        /* Not tracking cursor on mobile, revert to a fixed decorative position */
        transform: none;
        top: auto;
        left: auto;
        bottom: 2rem;
        right: 1rem;
        width: auto;
        height: auto;
    }
    
    #ascii-canvas pre {
        font-size: 5px; /* Even smaller for mobile */
    }
}

/* Light mode: slightly stronger for contrast on light bg */
html.light-mode #ascii-canvas.is-visible {
    opacity: 0.5;
}
