/* Critical CSS - โหลดก่อนเพื่อแสดงผลได้เร็วขึ้น */

/* CSS Containment for performance */
.portfolio-item {
    contain: layout style paint;
}

.plate-size {
    contain: layout style;
}

/* Reduce reflow */
img {
    max-width: 100%;
    height: auto;
}

/* Font loading optimization */
@font-face {
    font-family: 'Sarabun';
    font-display: swap;
}

/* Lazy loading placeholder */
.lazyload,
.lazyloading {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazyloaded {
    opacity: 1;
}

/* Reduce paint complexity */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU acceleration for animated elements */
.portfolio-link,
.btn,
.navbar {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce layout shift */
.navbar {
    height: 56px;
}

footer {
    min-height: 150px;
}
