* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    cursor: none !important;
    overflow: hidden;
}

body {
    font-family: "Jersey 20", sans-serif;
    font-size: 12pt;
    background-color: #d9d9d9;
    color: #7b636b;
    line-height: 1.4;
}

.custom-cursor {
    position: fixed;
    width: 100px;
    height: 100px;
    background-image: url('./cursors/current/ncursor2.png');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease;
    opacity: 0;
}

.custom-cursor.active { opacity: 1; }

.custom-cursor.hover { transform: translate(-50%, -50%) scale(1.5); }

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 18vh; /* fixed height as a ceiling */
    display: flex;
    justify-content: space-between; /* pushes name left and menu right */
    align-items: flex-end; /* bottom-aligns name and menu links */
    padding: 0 4vh 2vh 4vh; /* horizontal padding matches left: 4vh */
    z-index: 100;
    pointer-events: none; /* allows .ahh to be seen behind */
}

.name-container, .menu {
    pointer-events: auto; /* reenables interaction for links */
}

.name {
    font-size: clamp(40px, 14vh, 120px); /* min 40px, scales with height, max 120px */
    color: #7b636b;
    line-height: 0.8;
    white-space: nowrap; /* prevents name from wrapping to a second line */
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.menu-options {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.menu-options a {
    font-size: 20px;
    color: #7b636b;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.menu-options a:hover {
    opacity: 0.7;
}

.container {
    position: fixed;
    top: 18vh;  /* starts exactly where header ends */
    bottom: 0;
    left: 0;
    right: 0;    
    width: 100%;
    height: 82vh; /* fills remaining 82% of height */
    z-index: 5;
    pointer-events: none;
    overflow: visible;
}

.ahh {
    position: absolute;
    width: 250px;
    height: 150px;
    will-change: transform;
    
    animation: 
        bounceX 5s linear infinite alternate, 
        bounceY 3.8s linear infinite alternate;
}

@keyframes bounceX {
    from { left: 0; }
    to { left: calc(100% - 250px); }
}

@keyframes bounceY {
    from { top: 0; } 
    to { top: calc(100% - 150px); }
}

@media (max-width: 768px) {
    body { cursor: auto; } /* restore system cursor for touch/mobile */
    .custom-cursor { display: none; }

    .main-header {
        flex-direction: column; /* stack name over menu on narrow screens */
        align-items: flex-start;
        height: auto;
        padding-top: 20px;
    }

    .menu-options {
        align-items: flex-start; /* left align menu on mobile */
        margin-top: 10px;
    }

    .main-header {
        padding-bottom: 10px; /* tighter spacing on mobile */
    }

    .container {
        /*
         * Use dvh (dynamic viewport height) for mobile browser compatibility
         * Header is roughly: 20px padding-top + 38px name + 10px margin + 60px menu + 10px padding = ~138px
         * Round up to 140px for safety
         */
        top: 140px;
        height: calc(100dvh - 140px);
        bottom: auto; /* override desktop bottom: 0 */
    }

    .name {
        font-size: 48px; /* fixed size is more reliable on mobile */
    }

    .ahh {
        width: 150px;
        height: auto;
    }

    @keyframes bounceX {
        from { left: 0; }
        to { left: calc(100% - 150px); }
    }

    @keyframes bounceY {
        from { top: 0; }
        /* Image is ~90px tall (150px width scaled from 250x150 original) */
        to { top: calc(100% - 90px); }
    }
}