/* Homepage-specific CSS styles */

/* Custom StarKid colors and theme variables */
:root {
    --bs-primary: #6366f1;
    --bs-secondary: #ec4899;
    --bs-primary-rgb: 99, 102, 241;
    --bs-secondary-rgb: 236, 72, 153;
    --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Override aggressive fonts with softer alternatives and font loading optimization */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
}

/* Apply custom fonts after they load to prevent FOIT */
.fonts-loaded body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500; /* Softer font weight */
}

.fonts-loaded h1, 
.fonts-loaded h2, 
.fonts-loaded h3, 
.fonts-loaded h4, 
.fonts-loaded h5, 
.fonts-loaded h6 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500; /* Consistent softer weight */
}

/* Specific override for headings that need to be bolder */
.hero-title, .display-1, .display-2 {
    font-weight: 600 !important;
}

.display-1, .display-4 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500; /* Softer display headings */
}

.fonts-loaded .display-1, 
.fonts-loaded .display-4 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
}

.font-alt {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.fonts-loaded .font-alt {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
}

.navbar-brand {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
}

.lead {
    font-weight: 400;
    line-height: 1.7;
}

.bg-gradient-primary-to-secondary {
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
}
.text-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gradient-start-color {
    stop-color: #6366f1;
}
.gradient-end-color {
    stop-color: #ec4899;
}
.logo-badge {
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
    font-family: 'Inter', sans-serif;
}

/* Softer button styles */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

/* Gentler text weights */
.fw-bold {
    font-weight: 600 !important;
}

.small {
    font-weight: 400;
}

/* Device navigation styles */
.device-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.device-nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.device-nav-prev {
    left: -20px;
}

.device-nav-next {
    right: -20px;
}

.device-indicators {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: #6366f1;
    transform: scale(1.2);
}

.indicator:hover {
    background: rgba(99, 102, 241, 0.6);
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .device-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .device-nav-prev {
        left: -15px;
    }
    
    .device-nav-next {
        right: -15px;
    }
}

/* Core Web Vitals Optimizations */

/* Reduce Cumulative Layout Shift (CLS) */
.hero-device-container {
    contain: layout style paint;
    aspect-ratio: 9/16; /* Maintain iPhone aspect ratio */
}

/* Optimize largest contentful paint (LCP) */
.hero-content {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Prevent layout shifts during image loading */
img {
    max-width: 100%;
    height: auto;
}

/* Optimize First Input Delay (FID) */
.btn, .navbar-toggler, .device-nav-btn {
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Preload critical fonts to improve loading */
.navbar-brand, h1, h2 {
    font-display: swap;
}

/* Prevent forced reflows by batch DOM operations */
.navbar-collapse.collapsing {
    transition: none !important;
}

/* Optimize Bootstrap transitions to prevent layout thrashing */
.navbar-collapse {
    will-change: height;
    contain: layout;
}

/* Reduce reflow on interactive elements */
.btn:hover, .btn:focus {
    transform: translate3d(0, -2px, 0);
    backface-visibility: hidden;
}

/* Optimize device image containers to prevent shifts */
.device-mockup img {
    transform: translateZ(0);
    will-change: opacity;
}