/* ============================================
   ALBERT-WAY CONSTRUCTION - OPTIMIZED STYLES
   Production Ready - Performance, SEO & A11y
   ============================================ */

/* CSS Custom Properties */
:root {
    --aw-black: #000000;
    --aw-red: #D8000C;
    --aw-white: #FFFFFF;
    --aw-gray: #333333;
    --aw-dark-gray: #1a1a1a;
    --focus-ring: 0 0 0 3px rgba(216, 0, 12, 0.5);
}

/* Base Styles */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

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

body {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@supports (-webkit-touch-callout: none) {
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: var(--aw-dark-gray);
}
::-webkit-scrollbar-thumb {
    background: var(--aw-red);
    border-radius: 6px;
    border: 2px solid var(--aw-dark-gray);
}
::-webkit-scrollbar-thumb:hover {
    background: #ff1a1a;
}

* {
    scrollbar-width: 12px;
    scrollbar-color: var(--aw-red) var(--aw-dark-gray);
}

/* Selection */
::selection {
    background: rgba(216, 0, 12, 0.3);
    color: var(--aw-white);
}

/* Logo Styles */
#nav-logo {
    filter: drop-shadow(0 0 0 transparent);
    transition: all 0.3s ease;
}

#nav-logo:hover {
    filter: drop-shadow(0 0 25px rgba(216, 0, 12, 0.6));
}

#hero-logo {
    filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.5));
}

#hero-logo-container:hover #hero-logo {
    filter: drop-shadow(0 15px 50px rgba(216, 0, 12, 0.3));
}

#hero-logo-container {
    cursor: grab;
}

#hero-logo-container:active {
    cursor: grabbing;
}

/* Image Loading States */
img[alt*="Albert-Way"] {
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

img[alt*="Albert-Way"].loaded,
img[src*="cloudinary.com"] {
    animation: none;
    background: transparent;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

img[src*="Logo_de_Albert-Way_Services"] {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Loading States */
.js-enabled .reveal,
.js-enabled .reveal-text > * {
    opacity: 0;
}

.js-enabled .reveal.visible,
.js-enabled .reveal-text.visible > * {
    opacity: 1;
}

.no-js .reveal,
.no-js .reveal-text > * {
    opacity: 1 !important;
    transform: none !important;
}

img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img.loaded,
img[loading="eager"] {
    opacity: 1;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .floating {
        animation-duration: 8s;
    }
    
    h1 {
        font-size: clamp(2rem, 8vw, 2.5rem) !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: clamp(1.75rem, 6vw, 2.25rem) !important;
    }
    
    #home {
        min-height: 100svh;
        padding-top: 100px;
        padding-bottom: 60px;
    }
    
    #mobile-menu {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }
    
    button, 
    a,
    [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px !important;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    video {
        display: none;
    }
    
    #home video,
    .project-card video,
    .service-card video {
        display: block;
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    h1 {
        font-size: 3.5rem !important;
    }
}

/* Print Styles */
@media print {
    .whatsapp-float,
    .call-float,
    #canvas-container,
    #mobile-menu-btn {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .glass, .glass-red {
        background: white !important;
        border: 1px solid #ccc !important;
        color: black !important;
    }
}

/* Safe Area Insets */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .whatsapp-float,
    .call-float {
        right: max(30px, env(safe-area-inset-right));
        bottom: max(30px, env(safe-area-inset-bottom));
    }
}/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .floating {
        animation-duration: 8s;
    }
    
    /* Ensure text is readable on small screens - WCAG compliant */
    h1 {
        font-size: clamp(2rem, 8vw, 2.5rem) !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: clamp(1.75rem, 6vw, 2.25rem) !important;
    }
    
    /* Adjust hero section for mobile */
    #home {
        min-height: auto;
        min-height: 100svh;
        padding-top: 100px;
        padding-bottom: 60px;
    }
    
    /* Fix mobile menu animation */
    #mobile-menu {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }
    
    /* Ensure buttons are easy to tap - WCAG 2.5.5 */
    button, 
    a,
    [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better touch targets for form elements */
    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    /* Prevent horizontal overflow */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Optimize video backgrounds on mobile */
    video {
        display: none;
    }
    
    #home video,
    .project-card video,
    .service-card video {
        display: block;
    }
}/* Custom Scrollbar - accessible */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: #1a1a1a;
}
::-webkit-scrollbar-thumb {
    background: #D8000C;
    border-radius: 6px;
    border: 2px solid #1a1a1a;
}
::-webkit-scrollbar-thumb:hover {
    background: #ff1a1a;
}
/* Firefox scrollbar */
* {
    scrollbar-width: 12px;
    scrollbar-color: #D8000C #1a1a1a;
}/* Albert-Way Construction - Custom Styles */
/* Production Ready - Optimized for Performance, SEO & Accessibility */

/* CSS Custom Properties for theming */
:root {
    --aw-black: #000000;
    --aw-red: #D8000C;
    --aw-white: #FFFFFF;
    --aw-gray: #333333;
    --aw-dark-gray: #1a1a1a;
    --focus-ring: 0 0 0 3px rgba(216, 0, 12, 0.5);
}

/* Smooth scroll behavior - respect user preferences */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}/* Albert-Way Construction - Custom Styles */
/* Optimized for Mobile and Desktop */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent text size adjustment on mobile */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Improve touch action on mobile */
body {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Fix for iOS momentum scrolling */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Prevent layout shift from scrollbar */
html {
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

/* Custom selection color */
::selection {
    background: rgba(216, 0, 12, 0.3);
    color: #FFFFFF;
}

/* Logo hover enhancement - optimized for transparent PNG */
#nav-logo {
    filter: drop-shadow(0 0 0 transparent);
    transition: all 0.3s ease;
}

#nav-logo:hover {
    filter: drop-shadow(0 0 25px rgba(216, 0, 12, 0.6));
}

/* Hero logo with enhanced glow for transparent background */
#hero-logo {
    filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.5));
}

#hero-logo-container:hover #hero-logo {
    filter: drop-shadow(0 15px 50px rgba(216, 0, 12, 0.3));
}

/* Hero logo container */
#hero-logo-container {
    cursor: grab;
}

#hero-logo-container:active {
    cursor: grabbing;
}

/* Loading state for logo images from Cloudinary */
img[alt*="Albert-Way"] {
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

img[alt*="Albert-Way"].loaded,
img[src*="cloudinary.com"] {
    animation: none;
    background: transparent;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Optimized display for transparent PNG logo */
img[src*="Logo_de_Albert-Way_Services"] {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .floating {
        animation-duration: 8s;
    }
    
    /* Ensure text is readable on small screens */
    h1 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }
    
    /* Adjust hero section for mobile */
    #home {
        min-height: auto;
        padding-top: 120px;
        padding-bottom: 60px;
    }
    
    /* Fix mobile menu animation */
    #mobile-menu {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Ensure buttons are easy to tap */
    button, 
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent horizontal overflow */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    h1 {
        font-size: 3.5rem !important;
    }
}

/* Print Styles */
@media print {
    .whatsapp-float,
    .call-float,
    #canvas-container,
    #mobile-menu-btn {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .glass, .glass-red {
        background: white !important;
        border: 1px solid #ccc !important;
        color: black !important;
    }
}

/* Reduced Motion Preferences */
@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;
    }
    
    .floating {
        animation: none !important;
    }
}

/* Loading States */
.js-enabled .reveal,
.js-enabled .reveal-text > * {
    opacity: 0;
}

.js-enabled .reveal.visible,
.js-enabled .reveal-text.visible > * {
    opacity: 1;
}

/* No JS fallback */
.no-js .reveal,
.no-js .reveal-text > * {
    opacity: 1 !important;
    transform: none !important;
}

/* Image Loading States */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img.loaded,
img[loading="eager"] {
    opacity: 1;
}

/* Fix for iOS input zoom */
@media screen and (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .whatsapp-float,
    .call-float {
        right: max(30px, env(safe-area-inset-right));
        bottom: max(30px, env(safe-area-inset-bottom));
    }
}
