:root {
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;
    --primary-950: #1e1b4b;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hjp-Ek-_EeA.woff2') format('woff2');
}

@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/spacegrotesk/v13/V8mQoQDjQSkFtoMM3T6r8E7mF71Q-gOoraIAEj7oLXsk.woff2') format('woff2');
}

body {
    background-color: #0f172a;
    color: #f8fafc;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

.font-display {
    font-family: 'Space Grotesk', sans-serif;
}

/* Animations */
@keyframes float-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.animate-float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fade-in 0.5s ease-out forwards;
}

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

.animate-hero-fade-in {
    animation: hero-fade-in 0.45s ease-out forwards;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.6); }
}

@keyframes shine {
    from { mask-position: 150%; -webkit-mask-position: 150%; }
    to { mask-position: -50%; -webkit-mask-position: -50%; }
}

/* New Animations for Floating Cards */
.perspective-1000 {
    perspective: 1000px;
}

/* Hero floating cards: keep centered even if utility CSS is incomplete */
#hero-cards-wrapper {
    position: relative;
    min-height: 500px;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

@media (min-width: 768px) {
    #hero-cards-wrapper {
        display: flex;
    }
}

@media (min-width: 1024px) {
    #hero-cards-wrapper {
        min-height: 600px;
    }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin-slow {
    animation: spin-slow 20s linear infinite;
}

/* Components */
.glass-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.stat-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.subscription-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.subscription-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

/* Utilities */
.divider-gradient {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 1rem 0;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Store category chips: keep horizontal scroll inside container, not page */
#category-chips {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

#category-chips > * {
    flex: 0 0 auto;
}

/* Skeleton Loading */
.skeleton {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-glow {
    animation: glow-pulse 3s infinite;
}

.btn-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
    mask-image: linear-gradient(black, black);
    -webkit-mask-image: linear-gradient(black, black);
    mask-size: 200% 100%;
    -webkit-mask-size: 200% 100%;
    animation: shine 4s linear infinite;
    pointer-events: none;
}

/* Form Elements */
.input-neon {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.input-neon:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    outline: none;
}

/* Navbar & Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: all 0.3s ease;
}

.mobile-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.mobile-menu-link {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e2e8f0;
    transition: color 0.3s ease;
}

.mobile-menu-link:hover {
    color: var(--primary-400);
}

.brand-logo-text {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    letter-spacing: 0.1em;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-logo-tagline {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: #94a3b8;
    text-transform: uppercase;
    display: block;
    margin-top: -4px;
}

/* --- Hero 3D Carousel --- */
.hero-perspective {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.hero-card-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(340px, 80vw);
    height: 450px; /* Adjust based on content */
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Active Card (Center) */
.hero-card-active {
    z-index: 30;
    transform: translate(-50%, -50%) translateZ(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Previous Card (Left) */
.hero-card-prev {
    z-index: 10;
    transform: translate(-110%, -50%) scale(0.9);
    opacity: 0.6;
    pointer-events: auto;
    cursor: pointer;
    filter: grayscale(0.3);
}
.hero-card-prev:hover {
    filter: grayscale(0);
    opacity: 0.9;
    z-index: 25; /* Bring forward on hover */
    transform: translate(-105%, -50%) scale(0.92);
}

/* Next Card (Right) */
.hero-card-next {
    z-index: 10;
    transform: translate(10%, -50%) scale(0.9);
    opacity: 0.6;
    pointer-events: auto;
    cursor: pointer;
    filter: grayscale(0.3);
}
.hero-card-next:hover {
    filter: grayscale(0);
    opacity: 0.9;
    z-index: 25; /* Bring forward on hover */
    transform: translate(5%, -50%) scale(0.92);
}

/* Far Previous (Hidden/Far Left) */
.hero-card-far-prev {
    z-index: 5;
    transform: translate(-170%, -50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
}

/* Far Next (Hidden/Far Right) */
.hero-card-far-next {
    z-index: 5;
    transform: translate(70%, -50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
}

/* Default Hidden */
.hero-card-hidden {
    z-index: 0;
    transform: translate(-50%, -50%) translateZ(-300px) scale(0.5);
    opacity: 0;
    pointer-events: none;
    display: none; /* Optimize rendering */
}
