@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    overflow: hidden;
    background: #1a3a35;
    font-family: 'Arial', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#canvas {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    touch-action: manipulation; /* Better touch handling on mobile */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#svg-wrapper {
    width: 100%;
    height: 100%;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

#main-svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Continuous rotation - activated after 8 clicks */
#svg-wrapper.continuous-rotate {
    -webkit-animation: continuousRotation 15s linear infinite;
    animation: continuousRotation 15s linear infinite;
    will-change: transform;
}

@-webkit-keyframes continuousRotation {
    0% {
        -webkit-transform: rotateY(0deg);
        transform: rotateY(0deg);
    }
    100% {
        -webkit-transform: rotateY(360deg);
        transform: rotateY(360deg);
    }
}

@keyframes continuousRotation {
    0% {
        -webkit-transform: rotateY(0deg);
        transform: rotateY(0deg);
    }
    100% {
        -webkit-transform: rotateY(360deg);
        transform: rotateY(360deg);
    }
}

.endpoint-dot {
    fill: white;
}

#connecting-path {
    /* Transition handled in JavaScript for better control */
}

#contact-link {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-family: 'Comfortaa', cursive;
    font-weight: 500;
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border: 2px solid white;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
}

#contact-link.show {
    -webkit-animation: slideUp 0.6s ease-out forwards;
    animation: slideUp 0.6s ease-out forwards;
}

#contact-link:hover {
    background: white;
    color: #1a3a35;
}

.hidden {
    display: none;
}

@-webkit-keyframes slideUp {
    from {
        opacity: 0;
        -webkit-transform: translate(-50%, 20px);
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translate(-50%, 0);
        transform: translate(-50%, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        -webkit-transform: translate(-50%, 20px);
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translate(-50%, 0);
        transform: translate(-50%, 0);
    }
}

#copyright {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Comfortaa', cursive;
    font-size: 14px;
    color: white;
    opacity: 0.7;
    z-index: 99;
    white-space: nowrap;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #contact-link {
        font-size: 18px;
        padding: 10px 20px;
        bottom: 50px;
        max-width: 80%;
        text-align: center;
        white-space: nowrap;
    }

    #copyright {
        font-size: 11px;
        bottom: 15px;
    }
}

@media (max-width: 480px) {
    #contact-link {
        font-size: 16px;
        padding: 8px 16px;
        bottom: 55px;
        border-width: 1.5px;
    }

    #copyright {
        font-size: 10px;
        bottom: 18px;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    #contact-link {
        font-size: 14px;
        padding: 6px 12px;
        bottom: 35px;
    }

    #copyright {
        font-size: 9px;
        bottom: 5px;
    }
}
