/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    background: #000;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 200vh;
    line-height: 1.6;
}

/* Header */
header {
    text-align: center;
    padding: 100px 20px;
    background: linear-gradient(to bottom, #000, #111);
    position: relative;
}

h1 {
    font-family: 'Great Vibes', cursive;
    color: #FFD700;
    font-size: 4em;
    margin: 0 0 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    to { text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4); }
}

header p {
    font-size: 1.2em;
    color: #ccc;
    max-width: 600px;
    margin: 0 auto;
}

/* Gear cluster */
.gear-cluster {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    height: 300px;
    z-index: 10;
    opacity: 0.8;
    pointer-events: none;
    perspective: 800px;
    transform-style: preserve-3d;
    transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hidden state: fade out and slide toward the bottom-right corner */
.gear-cluster.gears-hidden {
    opacity: 0;
    transform: translate(60px, 60px) scale(0.6);
    pointer-events: none;
}

.gear {
    position: absolute;
    transition: transform 0.1s linear;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    transform-style: preserve-3d;
    transform: translateZ(50px) rotateX(15deg) rotateY(10deg);
}

#gear1 {
    width: 150px;
    height: 150px;
    bottom: 60px;
    left: 150px;
}

#gear2 {
    width: 90px;
    height: 90px;
    bottom: 192px;
    left: 180px;
}

#gear3 {
    width: 90px;
    height: 90px;
    bottom: 18px;
    left: 108px;
}

/* Gear toggle button (bottom center) */
.gear-toggle {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9em;
    letter-spacing: 0.02em;
    color: #ffd700;
    background: rgba(20, 16, 4, 0.7);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 22px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.25s ease;
}

.gear-toggle:hover {
    color: #fff8c0;
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 4px 18px rgba(255, 215, 0, 0.25);
}

.gear-toggle__icon {
    font-size: 1.15em;
    transition: transform 0.5s ease;
}

.gear-toggle:hover .gear-toggle__icon {
    transform: rotate(90deg);
}

/* Dim the button when gears are off */
.gear-toggle[aria-pressed="false"] {
    color: #998a55;
    border-color: rgba(255, 215, 0, 0.2);
}
.gear-toggle[aria-pressed="false"] .gear-toggle__icon {
    opacity: 0.6;
}

/* Main content */
.main-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Project section */
.project-section {
    padding: 50px 0;
}

.project-section h2 {
    font-family: 'Great Vibes', cursive;
    color: #FFD700;
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 250px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.1);
}

.project-card--1 {
    background-image: url("../images/orb-supernova.gif");
    background-size: cover;
    background-position: center center;
    background-attachment: scroll;
}

.project-card--2 {
    background-image: url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=400&h=300&fit=crop");
}

.project-card--3 {
    background-image: url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&h=300&fit=crop");
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.2);
}

.project-card h3 {
    font-family: 'Great Vibes', cursive;
    color: #FFD700;
    font-size: 1.8em;
    margin: 0 0 15px;
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

.project-card p {
    color: #ccc;
    font-size: 1em;
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

/* VR Section */
.vr-section {
    padding: 50px 0;
    text-align: center;
    background: linear-gradient(to bottom, #111, #000);
}

.vr-section h2 {
    font-family: 'Great Vibes', cursive;
    color: #FFD700;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.vr-intro {
    max-width: 800px;
    margin: 0 auto 40px;
    color: #ccc;
    font-size: 1.1em;
}

#enter-vr {
    background: linear-gradient(45deg, #FFD700, #D4AF37);
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    font-family: 'Great Vibes', cursive;
    border-radius: 25px;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

#enter-vr:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

#enter-vr:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#a-scene {
    width: 100%;
    height: 400px;
    border: 1px solid #FFD700;
    border-radius: 10px;
    margin: 0 auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #111;
    color: #ccc;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5em;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gear-cluster {
        width: 200px;
        height: 200px;
    }

    #gear1 {
        width: 100px;
        height: 100px;
        bottom: 40px;
        left: 100px;
    }

    #gear2, #gear3 {
        width: 60px;
        height: 60px;
    }

    #gear2 {
        bottom: 128px;
        left: 120px;
    }

    #gear3 {
        bottom: 12px;
        left: 72px;
    }

    header {
        padding: 50px 20px;
    }
}

@media (max-width: 480px) {
    .main-content {
        width: 95%;
        padding: 10px;
    }

    h1 {
        font-size: 2em;
    }

    .project-section h2, .vr-section h2 {
        font-size: 2em;
    }
}
