    /* --- Mouse trail canvas --- */
    #mouse-trail-canvas {
        position: fixed;
        inset: 0;
        pointer-events: none;
        z-index: 9998;
    }

    /* --- Right-side navigation rail --- */
    .side-nav {
        position: fixed;
        right: clamp(0.9rem, 1.2vw, 1.4rem);
        top: 50%;
        transform: translateY(-50%);
        z-index: 500;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.75rem;
    }

    .side-nav-item {
        position: relative;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        cursor: pointer;
        text-decoration: none;
        padding: 0.15rem 0;
    }

    .side-nav-item:hover .side-nav-label,
    .side-nav-item.active .side-nav-label {
        opacity: 1;
        transform: translateX(0);
    }

    .side-nav-label {
        font-family: 'Geist Mono', monospace;
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--accent-color);
        opacity: 0;
        transform: translateX(8px);
        transition: opacity 0.25s ease, transform 0.25s ease;
        white-space: nowrap;
        background: rgba(255, 255, 255, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.25);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 0.25rem 0.6rem;
        border-radius: 999px;
        pointer-events: none;
    }

    .side-nav-dot {
        position: relative;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--accent-color);
        opacity: 0.45;
        transition:
            opacity 0.25s ease,
            transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
            box-shadow 0.25s ease;
        flex-shrink: 0;
    }

    .side-nav-dot::after {
        content: '';
        position: absolute;
        inset: -6px;
        border-radius: inherit;
        border: 1px solid rgba(23, 149, 217, 0.28);
        opacity: 0;
        transform: scale(0.7);
    }

    .side-nav-item:hover .side-nav-dot,
    .side-nav-item.active .side-nav-dot {
        opacity: 1;
        transform: scale(1.5);
        box-shadow: 0 0 0 4px rgba(92, 184, 92, 0.25), 0 0 10px rgba(92, 184, 92, 0.3);
    }

    .side-nav-item.active .side-nav-dot {
        background: var(--navbar-color, #1795d9);
        box-shadow: 0 0 0 4px rgba(23, 149, 217, 0.25), 0 0 14px rgba(23, 149, 217, 0.4);
    }

    .side-nav-item.is-switching .side-nav-dot {
        animation: side-nav-blink 0.9s ease;
    }

    .side-nav-item.is-switching .side-nav-dot::after {
        animation: side-nav-ring 0.9s ease;
    }

    .side-nav-item.is-switching .side-nav-label {
        animation: side-nav-label-flash 0.55s ease;
    }

    @keyframes side-nav-blink {
        0% {
            opacity: 0.45;
            transform: scale(1);
        }

        35% {
            opacity: 1;
            transform: scale(1.85);
        }

        65% {
            opacity: 0.5;
            transform: scale(1.1);
        }

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

    @keyframes side-nav-ring {
        0% {
            opacity: 0;
            transform: scale(0.7);
        }

        35% {
            opacity: 0.95;
            transform: scale(1.9);
        }

        100% {
            opacity: 0;
            transform: scale(2.3);
        }
    }

    @keyframes side-nav-label-flash {
        0% {
            opacity: 0.45;
        }

        50% {
            opacity: 1;
        }

        100% {
            opacity: 1;
        }
    }

    @media (min-width: 320px) and (max-width: 767px) {
        .side-nav {
            right: 0.5rem;
            gap: 0.5rem;
        }

        .side-nav-label {
            font-size: 0.6rem;
            padding: 0.15rem 0.4rem;
        }

        .mouse-hint-text {
            font-size: 4rem;
        }

    }

    @media (min-width: 1025px) and (max-width: 1440px) and (max-height: 950px) {
        .side-nav {
            right: 0.85rem;
            gap: 0.65rem;
        }

        .side-nav-label {
            font-size: 0.68rem;
            padding: 0.2rem 0.5rem;
        }
    }

    /* Hide on mobile */
    @media (max-width: 1024px) {
        .side-nav {
            display: none;
        }
    }

    /* --- Section fix: all preview sections get proper height --- */
    section {
        height: 100vh;
        scroll-snap-align: center;
    }

    html.no-snap section {
        height: auto;
    }

    /* Ensure about-me-preview, projects-preview etc. lay out correctly */
    #about-me-preview,
    #projects-preview,
    #skills-preview,
    #contact-homepage {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: relative;
        overflow: hidden;
    }

    #about-me-preview .snap-section,
    #projects-preview .snap-section,
    #skills-preview .snap-section,
    #contact-homepage .snap-section {
        width: 100%;
        max-width: 1300px;
        margin: 0 auto;
        padding: 2rem 2rem 0 2rem;
    }

    /* Fix about-preview-container margin that caused corruption */
    .about-preview-container {
        width: 100%;
        max-width: 1200px;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 1rem 2rem;
        margin: 0 auto !important;
        /* Override the -250px margin */
    }

    /* Fix the skills container overflow */
    #skills-preview .skills-container {
        max-width: 1100px;
        width: 100%;
    }

    /* EASTER EGG MOUSE GAME STYLES */
    /* Mouse Hint Text - Shows click counter */
    .mouse-hint {
        position: absolute;
        bottom: -4rem;
        left: 50%;
        transform: translateX(-50%);
        margin-top: 1rem;
        opacity: 0;
        animation: fade-in-up 0.6s ease forwards;
        animation-delay: 0.2s;
    }

    .mouse-hint-text {
        font-family: 'Geist Mono', monospace;
        font-size: clamp(0.75rem, 2vw, 0.9rem);
        font-weight: 500;
        color: var(--accent-color, #5cb854);
        text-align: center;
        margin: 0;
    }

    /* Desktop: Arrow Label with animation */
    .mouse-arrow-label {
        position: absolute;
        right: -6rem;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        animation: fade-in 0.6s ease forwards;
        animation-delay: 0.3s;
    }

    .arrow-text {
        font-family: 'Geist Mono', monospace;
        font-size: clamp(0.85rem, 2.5vw, 1rem);
        font-weight: 600;
        color: var(--accent-color, #5cb854);
        display: inline-block;
        animation: arrow-bounce 2s ease-in-out infinite;
    }

    @keyframes arrow-bounce {

        0%,
        100% {
            transform: translateX(0);
            opacity: 0.6;
        }

        25% {
            transform: translateX(8px);
            opacity: 0.8;
        }

        50% {
            transform: translateX(12px);
            opacity: 1;
        }

        75% {
            transform: translateX(6px);
            opacity: 0.7;
        }
    }

    @keyframes fade-in-up {
        from {
            opacity: 0;
            transform: translateX(-50%) translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
    }

    @keyframes fade-in {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    /* Game Overlay - Liquid Glass styled */
    .mouse-game-overlay {
        position: absolute;
        inset: 0;
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.1),
            inset 0 1px 2px rgba(255, 255, 255, 0.3);
        animation: glass-appear 0.5s ease forwards;
    }

    @keyframes glass-appear {
        from {
            opacity: 0;
            backdrop-filter: blur(5px);
        }

        to {
            opacity: 1;
            backdrop-filter: blur(15px);
        }
    }

    .mouse-game-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        width: 100%;
        height: 100%;
        padding: 2rem;
    }

    /* Tic-Tac-Toe Grid */
    .mouse-game-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        width: clamp(180px, 70vw, 280px);
        aspect-ratio: 1;
    }

    .mouse-game-cell {
        aspect-ratio: 1;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 0.75rem;
        background: rgba(255, 255, 255, 0.05);
        cursor: pointer;
        font-family: 'Geist Mono', monospace;
        font-size: clamp(1.5rem, 8vw, 3rem);
        font-weight: 700;
        color: var(--accent-color, #5cb854);
        display: flex;
        align-items: center;
        justify-content: center;
        transition:
            all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
            background 0.2s ease;
        outline: none;
        position: relative;
        overflow: hidden;
    }

    .mouse-game-cell:hover:not(.cell-locked) {
        background: rgba(92, 184, 92, 0.1);
        border-color: rgba(92, 184, 92, 0.5);
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(92, 184, 92, 0.2);
    }

    .mouse-game-cell:focus {
        outline: 2px solid var(--accent-color, #5cb854);
        outline-offset: 2px;
        box-shadow: 0 0 20px rgba(92, 184, 92, 0.3);
    }

    .mouse-game-cell.cell-marked {
        background: rgba(92, 184, 92, 0.15);
        border-color: var(--accent-color, #5cb854);
        animation: cell-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .mouse-game-cell.cell-locked {
        cursor: not-allowed;
        opacity: 0.6;
    }

    @keyframes cell-pop {
        0% {
            transform: scale(0.8) rotate(-5deg);
        }

        50% {
            transform: scale(1.1);
        }

        100% {
            transform: scale(1) rotate(0deg);
        }
    }

    /* Game Message - Win screen */
    .mouse-game-message {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
        text-align: center;
        animation: message-slide-in 0.6s ease forwards;
    }

    @keyframes message-slide-in {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .mouse-game-message p {
        font-family: 'Titillium Web', sans-serif;
        font-size: clamp(1rem, 4vw, 1.5rem);
        font-weight: 600;
        color: var(--accent-color, #5cb854);
        margin: 0;
    }

    .mouse-game-button {
        font-family: 'Geist Mono', monospace;
        font-size: clamp(0.85rem, 2vw, 1rem);
        font-weight: 600;
        color: var(--accent-color, #5cb854);
        background: rgba(92, 184, 92, 0.1);
        border: 1.5px solid var(--accent-color, #5cb854);
        border-radius: 0.75rem;
        padding: 0.75rem 1.75rem;
        cursor: pointer;
        transition:
            all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
            box-shadow 0.3s ease;
        outline: none;
    }

    .mouse-game-button:hover {
        background: rgba(92, 184, 92, 0.2);
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(92, 184, 92, 0.25);
    }

    .mouse-game-button:active {
        transform: translateY(0);
        box-shadow: 0 4px 12px rgba(92, 184, 92, 0.2);
    }

    .mouse-game-button:focus {
        outline: 2px solid var(--accent-color, #5cb854);
        outline-offset: 2px;
    }

    /* Make mouse image clickable */
    .mouse-image {
        cursor: pointer;
        transition: filter 0.3s ease;
    }

    .mouse-image:hover {
        filter: brightness(1.1) drop-shadow(0 0 8px rgba(92, 184, 92, 0.3));
    }

    .mouse-image:focus {
        outline: 2px solid var(--accent-color, #5cb854);
        outline-offset: 4px;
        border-radius: 0.5rem;
    }

    /* Mobile styles */
    @media (max-width: 768px) {

        /* Hide desktop arrow label on mobile */
        .mouse-arrow-label {
            display: none;
        }

        /* Show mobile hint instead */
        .mouse-hint::after {
            content: attr(data-mobile-hint);
        }

        .mouse-hint-text {
            font-size: clamp(0.7rem, 2.5vw, 0.85rem);
            max-width: 200px;
        }

        /* Ensure game overlay fits on mobile */
        .mouse-game-overlay {
            border-radius: 1.5rem;
        }

        .mouse-game-grid {
            width: clamp(160px, 80vw, 240px);
            gap: 0.6rem;
        }

        .mouse-game-cell {
            font-size: clamp(1.2rem, 6vw, 2.5rem);
            border-radius: 0.5rem;
        }

        .mouse-game-message p {
            font-size: clamp(0.9rem, 3.5vw, 1.2rem);
        }

        .mouse-game-button {
            font-size: clamp(0.75rem, 2vw, 0.9rem);
            padding: 0.6rem 1.5rem;
        }
    }