:root {
    --gold: #d4af37;
    --dark: #0a0a0a;
    --accent: #e63946;
    --gray-100: #f5f5f5;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    --rotation-speed: 60s;
    /* Responsive typography scale */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 3rem);
    --text-4xl: clamp(2.25rem, 1.8rem + 2.25vw, 3.75rem);
    --text-5xl: clamp(3rem, 2.5rem + 2.5vw, 4.5rem);
    --text-6xl: clamp(3.75rem, 3rem + 3.75vw, 6rem);
}

body {
    background-color: var(--dark);
    color: white;
    font-family: 'Outfit', sans-serif;
    scrollbar-gutter: stable;
}

/* Tailwind fallback colors - if CDN fails to load */
.text-dark { color: var(--dark); }
.text-gold { color: var(--gold); }
.text-accent { color: var(--accent); }
.text-gray-300 { color: var(--gray-300); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.bg-dark { background-color: var(--dark); }
.bg-gold { background-color: var(--gold); }
.bg-neutral-700 { background-color: var(--neutral-700); }
.bg-neutral-800 { background-color: var(--neutral-800); }
.bg-neutral-900 { background-color: var(--neutral-900); }
.bg-white { background-color: white; }
.bg-black { background-color: black; }
.text-white { color: white; }
.fill-white { fill: white; }

/* Custom Utilities */
.bg-radial-gradient {
    background: radial-gradient(circle at center, var(--tw-gradient-from), var(--tw-gradient-to));
}

/* Animations - Only apply if motion is allowed */
@media (prefers-reduced-motion: no-preference) {
    @keyframes rotate {
        from {
            transform: rotate(0deg);
        }
        to {
            transform: rotate(360deg);
        }
    }

    .animate-rotate {
        animation: rotate var(--rotation-speed) linear infinite;
    }

    /* Floating Animation for Ingredients */
    @keyframes float {
        0% { transform: translateY(0px); }
        50% { transform: translateY(-10px); }
        100% { transform: translateY(0px); }
    }

    .floating-asset {
        animation: float 4s ease-in-out infinite;
    }
}

/* Reduce motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Orbital System - New Implementation */
#orbital-wrapper {
    position: relative;
    aspect-ratio: 1;
    max-width: min(500px, 90vw);
    margin-inline: auto;
}

.orbital-pizza {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
}

.orbital-pizza img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Handwriting Font */
.font-handwriting {
    font-family: 'Caveat', cursive;
}

/* Parallax Items - only animate if motion is allowed */
@media (prefers-reduced-motion: no-preference) {
    .parallax-item {
        pointer-events: none;
        filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));
    }
}

/* Bento Accordion */
.accordion-item {
    transition: flex 0.7s cubic-bezier(0.25,1,0.5,1);
}

.accordion-item:hover {
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

@media (min-width: 768px) {
    .accordion-item:hover {
        flex: 2 !important;
    }
}

/* Spin animation - only with motion preference */
@media (prefers-reduced-motion: no-preference) {
    @keyframes spin-pizza {
        from {
            transform: translateY(-50%) rotate(0deg);
        }
        to {
            transform: translateY(-50%) rotate(360deg);
        }
    }

    .accordion-item:hover img,
    .accordion-item.active img {
        animation: spin-pizza 25s linear infinite;
    }
}

/* Mobile Accordion */
@media (max-width: 768px) {
    .accordion-item {
        transition: height 0.7s cubic-bezier(0.25,1,0.5,1);
    }
    
    .accordion-item.active {
        height: 300px !important;
    }
    
    .accordion-item.active .opacity-0 {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    
    .accordion-item.active img {
        opacity: 1 !important;
        right: -10% !important;
    }
}

/* Modal Styles */
#reservation-modal {
    transition: opacity 0.3s ease;
}

#reservation-modal.hidden {
    display: none;
}

#reservation-modal:not(.hidden) {
    display: flex;
}

@media (prefers-reduced-motion: no-preference) {
    #reservation-modal:not(.hidden) {
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    #reservation-modal .bg-neutral-900 {
        animation: slideUp 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    }

    @keyframes slideUp {
        from {
            transform: translateY(50px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

/* Form Input Focus */
#reservation-modal input:focus,
#reservation-modal select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Custom Scrollbar - Only show if needed */
@media (pointer: fine) {
    ::-webkit-scrollbar {
        width: 6px;
    }

    ::-webkit-scrollbar-track {
        background: var(--dark);
    }

    ::-webkit-scrollbar-thumb {
        background: #333;
        border-radius: 10px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--gold);
    }
}

/* Layering - GPU acceleration for supported transforms */
@media (prefers-reduced-motion: no-preference) {
    .pizza-wrapper {
        perspective: 1000px;
    }

    #main-pizza-img {
        transform: translate3d(0,0,0);
        will-change: transform;
    }
}

/* Remove will-change after animation */
.orbital-pizza:not([style*="visibility: hidden"]) {
    will-change: transform, opacity;
}
