/* Custom Styles for Sertifia Landing Page */

/* Ultra Smooth Scrolling - iPhone 120Hz Style */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enable hardware acceleration for smooth animations */
body {
    overflow-x: hidden;
    will-change: scroll-position;
    -webkit-overflow-scrolling: touch;
}

/* Smooth scroll sections with parallax effect */
section {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Custom animations with 120Hz smooth easing */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateZ(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateZ(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover effects with smooth easing */
.hover-scale {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.hover-scale:hover {
    transform: scale(1.05) translateZ(0);
}

/* Smooth transitions for all interactive elements */
a, button, .transition {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

/* Custom scrollbar with smooth appearance */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #B91C1C;
    border-radius: 5px;
    transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

::-webkit-scrollbar-thumb:hover {
    background: #991B1B;
}

/* Responsive images with smooth loading */
img {
    max-width: 100%;
    height: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Focus styles for accessibility with smooth transitions */
a:focus,
button:focus {
    outline: 2px solid #B91C1C;
    outline-offset: 2px;
    transition: outline-offset 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Smooth card hover effects */
.card-hover {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, box-shadow;
}

.card-hover:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Parallax effect for hero images */
.parallax {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

/* Mobile touch optimization */
@media (hover: none) and (pointer: coarse) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    a, button {
        touch-action: manipulation;
    }
}

/* High refresh rate optimization */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
    
    * {
        animation-duration: 0.8s;
        animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    }
}

/* Reduce motion for accessibility */
@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;
    }
}

/* Full-bleed image to edge - Design specific */
.image-full-right {
    position: relative;
    right: -6vw;
    max-width: calc(100% + 6vw);
    width: calc(100% + 6vw);
}

.image-full-left {
    position: relative;
    left: -3vw;
    max-width: calc(100% + 6vw);
    width: calc(100% + 6vw);
}

/* Remove decorations for seamless integration */
.image-seamless {
    box-shadow: none !important;
    border-radius: 0 !important;
}

@media (min-width: 768px) {
    .image-full-right {
        right: -8vw;
        max-width: calc(100% + 8vw);
        width: calc(100% + 8vw);
    }
    
    .image-full-left {
        left: -6vw;
        max-width: calc(100% + 8vw);
        width: calc(100% + 8vw);
    }
}

@media (min-width: 1024px) {
    .image-full-right {
        right: -10vw;
        max-width: calc(100% + 10vw);
        width: calc(100% + 10vw);
    }
    
    .image-full-left {
        left: -6vw;
        max-width: calc(100% + 10vw);
        width: calc(100% + 10vw);
    }
}

/* Tweak vertical alignment for left images so their baseline matches right images */
.image-full-left {
    transform: translateY(0) translateZ(0);
}

@media (min-width: 768px) {
    .image-full-left { transform: translateY(-1.5rem) translateZ(0); }
}

@media (min-width: 1024px) {
    .image-full-left { transform: translateY(-3rem) translateZ(0); }
}

@media (min-width: 1280px) {
    .image-full-left { transform: translateY(-3.5rem) translateZ(0); }
}

/* Adjustments for specific large preview images to reduce horizontal overflow */
.image-adjust {
    left: -4vw;
    max-width: calc(100% + 4vw);
    width: calc(100% + 4vw);
}

@media (min-width: 768px) {
    .image-adjust {
        left: -6vw;
        max-width: calc(100% + 6vw);
        width: calc(100% + 6vw);
    }
}

@media (min-width: 1024px) {
    .image-adjust {
        left: -8vw;
        max-width: calc(100% + 8vw);
        width: calc(100% + 8vw);
    }
}

/* Feature card style to match design: translucent rounded boxes */
.feature-card {
    background: rgba(255,255,255,0.06);
    padding: 1rem;
    border-radius: 1rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

@media (min-width: 768px) {
    .feature-card {
        padding: 1.25rem;
    }
}

/* Shift preview image left to create overlap with heading */
.preview-shift {
    margin-left: -1.5rem;
}

@media (min-width: 768px) {
    .preview-shift { margin-left: -3.5rem; }
}

@media (min-width: 1024px) {
    .preview-shift { margin-left: -7rem; }
}

@media (min-width: 1280px) {
    .preview-shift { margin-left: -9rem; }
}

/* Solutions section absolute image placement */
.solutions-preview { 
    max-width: 680px;
    width: 100%;
    margin-left: 0; /* align under heading */
}

@media (min-width: 768px) {
    .solutions-preview { margin-left: 0; }
}

@media (min-width: 1024px) {
    .solutions-preview { margin-left: 0; }
}

@media (min-width: 1280px) {
    .solutions-preview { margin-left: 0; }
}
