:root {
    --brand-red: #A53B47;
    --brand-gold: #D4AF37;
    --text-dark: #333333;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

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

/* Smooth scrolling for all sections */
section {
    will-change: transform;
}

#home {
    will-change: transform;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Keep hero section same size when scrolled - desktop/tablet only */
@media (min-width: 768px) {
    #home.hero-scrolled {
        padding-top: 1.0180485rem !important;
        padding-bottom: 3.817044rem !important;
    }

    #home.hero-scrolled h1 {
        margin-bottom: 1.5rem !important;
        font-size: 2.4rem !important;
        line-height: 1.1 !important;
    }

    #home.hero-scrolled h1 span {
        font-size: 1.5rem !important;
        margin-top: 0.5rem !important;
    }

    #home.hero-scrolled p {
        margin-bottom: 2rem !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    #home.hero-scrolled .btn-primary,
    #home.hero-scrolled .btn-outline {
        padding: 1rem 2rem !important;
        font-size: 0.9rem !important;
    }
}

/* Smooth navigation */
nav {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
}

.font-poppins { font-family: 'Poppins', sans-serif; }
.text-brand-red { color: var(--brand-red); }
.bg-brand-red { background-color: var(--brand-red); }
.text-brand-gold { color: var(--brand-gold); }
.bg-brand-gold { background-color: var(--brand-gold); }
.text-custom-dark { color: var(--text-dark); }
.bg-custom-dark { background-color: var(--text-dark); }
.border-brand-red { border-color: var(--brand-red); }
.hover-brand-gold:hover { color: var(--brand-gold); }

.hero-gradient {
    background: linear-gradient(135deg, rgba(165, 59, 71, 0.85) 0%, rgba(139, 75, 92, 0.75) 100%);
}

.btn-primary {
    background-color: var(--brand-red);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, background-color;
}

.btn-primary:hover {
    background-color: var(--brand-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid white;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, background-color;
}

.btn-outline:hover {
    background-color: var(--brand-gold);
    color: var(--text-dark);
    border-color: var(--brand-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.service-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    backface-visibility: hidden;
}

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

.portfolio-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    backface-visibility: hidden;
}

.portfolio-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Instagram gradient colors */
.instagram-icon {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.instagram-bg {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.instagram-bg:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    opacity: 0.9;
}

/* LinkedIn official color */
.linkedin-bg {
    background-color: #0A66C2;
}

.linkedin-bg:hover {
    background-color: #004182;
}

/* YouTube official color */
.youtube-bg {
    background-color: #FF0000;
}

.youtube-bg:hover {
    background-color: #CC0000;
}

/* Perfect circle icons */
.icon-circle {
    aspect-ratio: 1 / 1;
    min-width: 0;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.icon-circle:hover {
    transform: scale(1.1);
}

/* Smooth links and buttons */
a, button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth images */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    background-color: #f3f4f6;
}

/* Image loading optimization */
.carousel-slide img,
.portfolio-item img {
    content-visibility: auto;
}

/* Portfolio filter buttons */
.portfolio-filter {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, background-color;
}

.portfolio-filter:hover {
    transform: translateY(-2px);
}

/* YouTube embed responsive container */
.portfolio-item iframe {
    border-radius: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form inputs */
input, textarea, select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus, textarea:focus, select:focus {
    transform: scale(1.01);
}

/* Smooth mobile menu */
#mobile-menu {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image Carousel */
.carousel-container {
    min-height: 600px;
    will-change: transform;
}

.carousel-slides {
    position: relative;
    width: 100%;
    min-height: 600px;
}

@media (min-width: 1024px) {
    .carousel-container {
        min-height: 800px;
    }
    .carousel-slides {
        min-height: 800px;
    }
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
    backface-visibility: hidden;
}

.carousel-slide.active {
    opacity: 1;
    position: relative;
}

.carousel-slide img {
    will-change: transform;
    transition: transform 0.3s ease-out;
}

.carousel-dots {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    will-change: transform, background-color;
}

.carousel-dots span:hover {
    transform: scale(1.3);
}

.carousel-dots span.active {
    background-color: #D4AF37;
    border-color: #D4AF37;
    transform: scale(1.2);
}

.carousel-prev, .carousel-next {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, background-color;
    backdrop-filter: blur(4px);
}

.carousel-prev:hover, .carousel-next:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Fixed hero section */
.hero-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
}

.carousel-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
}

/* Lightbox Modal for Portfolio Images */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-image-container {
    position: relative;
    max-width: 70%;
    max-height: 80vh;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
    animation: zoomIn 0.3s ease-in-out;
}

.lightbox-image-container img {
    display: block;
    max-width: 100%;
    max-height: calc(80vh - 24px);
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

.lightbox-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background-color: var(--brand-red);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.lightbox-close-btn:hover {
    background-color: var(--brand-gold);
    transform: rotate(90deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.portfolio-item img {
    cursor: pointer;
}

/* Mobile-friendly lightbox adjustments */
@media (max-width: 768px) {
    .lightbox-image-container {
        max-width: 95%;
        max-height: 90vh;
        padding: 8px;
        margin: 10px;
    }

    .lightbox-image-container img {
        max-height: calc(90vh - 16px);
        border-radius: 4px;
    }

    .lightbox-close-btn {
        top: 5px;
        right: 5px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

/* Tablet hero section (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    #home {
        padding-top: 6rem !important;
        padding-bottom: 4rem !important;
    }

    #home > div {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    #home h1 {
        margin-bottom: 1.5rem !important;
        font-size: 2.4rem !important;
        line-height: 1.1 !important;
    }

    #home h1 span {
        font-size: 1.5rem !important;
        margin-top: 0.5rem !important;
        display: block;
    }

    #home p {
        margin-bottom: 2rem !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
        max-width: 48rem !important;
    }

    #home .btn-primary,
    #home .btn-outline {
        padding: 1rem 2rem !important;
        font-size: 0.9rem !important;
    }
}

/* Desktop hero section (1024px and above) */
@media (min-width: 1024px) {
    #home {
        padding-top: 6rem !important;
        padding-bottom: 4rem !important;
    }

    #home > div {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    #home h1 {
        margin-bottom: 1.5rem !important;
        font-size: 2.4rem !important;
        line-height: 1.1 !important;
    }

    #home h1 span {
        font-size: 1.5rem !important;
        margin-top: 0.5rem !important;
        display: block;
    }

    #home p {
        margin-bottom: 2rem !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
        max-width: 48rem !important;
    }

    #home .btn-primary,
    #home .btn-outline {
        padding: 1rem 2rem !important;
        font-size: 0.9rem !important;
    }
}

/* Mobile navigation with hide/show on scroll */
@media (max-width: 768px) {
    nav {
        position: fixed !important;
        width: 100%;
        top: 0;
        left: 0;
        right: 0;
        z-index: 50;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }

    /* Mobile hero section - increased padding */
    #home {
        padding-top: 8rem !important;
        padding-bottom: 2rem !important;
    }

    #home h1 {
        margin-bottom: 0.6rem !important;
        font-size: 2.25rem !important;
        line-height: 1.2 !important;
    }

    #home h1 span {
        font-size: 1.25rem !important;
        margin-top: 0.35rem !important;
    }

    #home p {
        margin-bottom: 0.9rem !important;
        font-size: 1.125rem !important;
        line-height: 1.5 !important;
    }

    #home .btn-primary,
    #home .btn-outline {
        padding: 0.65rem 1.25rem !important;
        font-size: 1rem !important;
    }
}