/* Homepage Styles - Modern Dark Theme */

/* Page Header - Bright Theme */
.page-header {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.98) 0%, rgba(74, 158, 108, 0.06) 100%);
    color: var(--text-primary);
    padding: 5rem 3rem 3rem;
    text-align: center;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(74, 158, 108, 0.02) 2px,
        rgba(74, 158, 108, 0.02) 4px
    );
}

.page-header h1 {
    color: var(--text-primary);
    font-size: 4rem;
    margin-bottom: 1rem;
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
}

/* Hero Section - Bright & Welcoming with Optimized Video */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    color: var(--text-primary);
    text-align: center;
    overflow: hidden;
    background: var(--bg-primary); /* Fallback solid color */
}

/* Hero Video Background - Optimized for Bright Theme */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
    opacity: 0.35; /* Visible but not overwhelming */
    /* Smooth transitions */
    transition: opacity 0.5s ease-in-out;
}

/* When video is loading, show poster at full opacity */
.hero-video[poster] {
    background-size: cover;
    background-position: center;
}

/* Light overlay for text readability - adjusted for video */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.20) 0%,
        rgba(248, 249, 250, 0.20) 50%,
        rgba(74, 158, 108, 0.05) 100%
    );
    z-index: 1;
}

/* Fallback image for browsers without video support */
.hero-fallback-image {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
    opacity: 0.35;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(74, 158, 108, 0.015) 2px, rgba(74, 158, 108, 0.015) 4px);
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(74, 158, 108, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, 50px) scale(1.1); }
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    padding: 2rem;
}

/* Hero Logo - Animated with 3D Flip */
.hero-logo {
    width: 200px;
    height: 200px;
    margin: 0 auto 3rem;
    display: block;
    /* Initial state before page load */
    transform: scale(0) rotateY(-360deg);
    opacity: 0;
    transform-style: preserve-3d;
    perspective: 1000px;
    filter: drop-shadow(0 10px 30px rgba(45, 95, 63, 0.4));
    will-change: transform, opacity;
    cursor: pointer;
}

/* Apply transition only after page load animation completes */
.hero-logo.can-transition {
    transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hidden state when scrolled down */
.hero-logo.logo-hidden {
    transform: scale(0.2) rotateY(360deg);
    opacity: 0;
    pointer-events: none;
}

/* Page load entrance animation */
@keyframes logoEntrance {
    0% {
        transform: scale(0) rotateY(-360deg);
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

/* Float-bounce animation on hover */
@keyframes floatBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-15px) scale(1.05);
    }
}

.hero-logo:hover {
    animation: floatBounce 0.6s ease-in-out infinite;
}

.hero h1 {
    font-size: 5rem;
    font-weight: 900;
    margin-bottom: 2rem;
    line-height: 1.1;
    animation: slideDown 1s ease-out;
    position: relative;
}

.hero h1::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
    animation: expand 1.5s ease-out 0.5s both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes expand {
    from { width: 0; }
    to { width: 150px; }
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.8;
    animation: fadeIn 1s ease-out 0.3s both;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeIn 1s ease-out 0.6s both;
}

/* Geometric shapes background */
.hero-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    opacity: 0.03;
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Services Preview */
.services-preview {
    padding: 8rem 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
    position: relative;
}

.section-header h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 1s ease-out;
}

.section-header h2::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-green);
}

.section-header p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.service-card {
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease-in-out, background-size 0.6s ease-in-out;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background image overlay with dark gradient - subtle darkening for text readability */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 100%);
    transition: all 0.4s ease-in-out;
    z-index: 0;
}

/* Service content wrapper */
.service-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Hover effect - reduce overlay to show more image, zoom, and lift */
.service-card:hover {
    background-size: 110%;
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.service-card:hover::before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.25) 100%);
}

.service-card h3 {
    margin-bottom: 1.25rem;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.3px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0px 0px 20px rgba(0, 0, 0, 0.8), -1px -1px 2px rgba(255, 255, 255, 0.3);
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.5);
}

.service-card p {
    color: #ffffff;
    font-weight: 600;
    line-height: 1.6;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9), 0px 0px 15px rgba(0, 0, 0, 0.7);
}

/* Projects Slideshow */
.projects-slideshow-section {
    position: relative;
}

.projects-slideshow-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    height: 500px;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.slideshow-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.slideshow-image.active {
    opacity: 1;
}

.slideshow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    color: var(--accent-green-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.slideshow-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.slideshow-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.slideshow-prev {
    left: 20px;
}

.slideshow-next {
    right: 20px;
}

.slideshow-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.dot.active {
    background: var(--accent-green);
    box-shadow: 0 2px 8px rgba(74, 158, 108, 0.5);
}

/* Featured Projects - Bright Theme */
.featured-projects {
    padding: 8rem 0;
    background: var(--bg-secondary);
    position: relative;
}

.featured-projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent-green) 50%,
        transparent 100%);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.project-card {
    background: white;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(74, 158, 108, 0.04) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--accent-green);
    box-shadow: var(--shadow-lg);
}

.project-card:hover::after {
    opacity: 1;
}

.project-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-image {
    transform: scale(1.1);
}

.project-info {
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.project-info h3 {
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
}

.project-location {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Call to Action */
.cta-section {
    background: linear-gradient(135deg, var(--accent-green-dark) 0%, var(--accent-green) 100%);
    color: var(--text-primary);
    padding: 8rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 20px
    );
    animation: slide 20s linear infinite;
}

@keyframes slide {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.cta-section h2 {
    color: var(--text-primary);
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.cta-section .btn-secondary {
    background: var(--text-primary);
    color: var(--accent-green-dark);
    border: none;
}

.cta-section .btn-secondary:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    transform: translateY(-5px);
}

.cta-section .btn-outline {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.cta-section .btn-outline:hover {
    background: var(--text-primary);
    color: var(--accent-green-dark);
}

/* About Preview */
.about-preview {
    padding: 8rem 0;
    background: var(--bg-primary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-text {
    padding-right: 3rem;
    padding-left: 2rem;
}

.about-text h3 {
    margin-bottom: 1.5rem;
}

.about-features {
    padding-left: 0;
    margin-left: 1.5rem;
}

/* Hide mobile overlay on desktop */
.service-title-overlay {
    display: none;
}

/* Reverse layout for service details */
.about-content-reverse {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-content-reverse .about-text {
    order: 2;
}

.about-content-reverse .about-image-container {
    order: 1;
}

/* About Page Content Layout */
.about-content-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 3rem; /* Desktop: comfortable spacing from edges */
}

.about-text-flow {
    width: 100%;
}

/* Clearfix for floated elements */
.about-text-flow::after {
    content: "";
    display: table;
    clear: both;
}

/* Ensure text wraps properly around and under video */
.about-text-flow h2,
.about-text-flow h3,
.about-text-flow p,
.about-text-flow ul,
.about-text-flow ol {
    clear: none;
    margin-left: 0;
    margin-right: 0;
}

/* First heading aligns naturally with text flow */
.about-text-flow > h2:first-child {
    margin-top: 0;
    margin-bottom: 2rem;
}

.about-video-slideshow {
    flex-shrink: 0; /* Don't shrink the video container */
    width: 400px;
    height: 600px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    position: relative;
}

/* Inline video slideshow - when embedded in markdown content */
.about-text-flow .about-video-slideshow {
    float: right;
    margin: 0 0 2rem 3rem;
    flex-shrink: unset; /* Reset flex properties when inline */
}

.slideshow-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    will-change: opacity; /* Optimize for opacity changes */
}

.slideshow-video.active {
    opacity: 1;
    z-index: 1;
}

.about-text h2 {
    margin-bottom: 2rem;
    font-size: 3rem;
}

.about-text p {
    font-size: 1.125rem;
    line-height: 1.9;
    margin-bottom: 2rem;
}

.about-features {
    list-style: none;
    margin-top: 2.5rem;
}

.about-features li {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.about-features li:hover {
    background: rgba(74, 158, 108, 0.04);
    padding-left: 1rem;
}

.about-features li:before {
    content: '✓';
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-dark) 100%);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(74, 158, 108, 0.2);
}

.image-with-caption {
    margin: 0;
}

.about-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    transition: all 0.4s ease;
    display: block;
}

.about-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.image-caption {
    margin-top: 1.25rem;
    padding: 1rem 1.5rem;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 3px solid var(--accent-green);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    font-style: italic;
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-green);
    box-shadow: var(--shadow-sm);
}

/* Slideshow Styles - Bright Theme */
.slideshow-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: var(--bg-secondary);
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
}

.slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-slide.active {
    opacity: 1;
    z-index: 1;
}

.slideshow-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.slideshow-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95), transparent);
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
    z-index: 2;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.slideshow-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 1.1rem;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.slideshow-placeholder span {
    display: block;
    padding: 2rem;
    border: 2px dashed var(--border-subtle);
    border-radius: 1rem;
}

/* Team Grid Styles */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.team-card {
    background: white;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 1.25rem;
    border: 1px solid var(--border-subtle);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 158, 108, 0.05), transparent);
    transition: left 0.5s ease;
}

.team-card:hover::before {
    left: 100%;
}

.team-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-green);
    box-shadow: var(--shadow-lg);
    background: white;
}

.team-photo {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent-green);
    box-shadow: 0 10px 30px rgba(74, 158, 108, 0.2);
    transition: all 0.3s ease;
}

.team-card:hover .team-photo img {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(74, 158, 108, 0.3);
}

.team-info h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.team-position {
    color: var(--accent-green-light);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.team-bio {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.team-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

/* Markdown Content Styling */
.about-text h2 {
    color: var(--text-primary);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

.about-text h2:first-child {
    margin-top: 0;
}

.about-text h3 {
    color: var(--text-primary);
    font-size: 1.75rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.about-text p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.about-text ul,
.about-text ol {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.about-text li {
    margin-bottom: 0.5rem;
}

/* YouTube embed in markdown content - Bright Theme */
.youtube-embed-wrapper {
    position: relative;
    width: 100%;
    margin: 2rem 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.youtube-embed-wrapper iframe {
    position: relative;
    display: block;
    width: 100%;
    border: 0;
}

.youtube-embed-wrapper video {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    border: 0;
}

/* Optional: When YouTube video is floated right (like the video slideshow) */
.youtube-embed-wrapper.float-right {
    float: right;
    max-width: 500px;
    margin: 0 0 2rem 3rem;
}

/* Responsive */
@media (max-width: 968px) {
    .hero-logo {
        width: 150px;
        height: 150px;
        margin-bottom: 2.5rem;
    }

    .hero h1 {
        font-size: 4rem;
    }

    .about-content,
    .about-content-reverse {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-content-reverse .about-text,
    .about-content-reverse .about-image-container {
        order: unset;
    }

    .about-content-wrap {
        padding: 0 2rem; /* Tablet: adequate spacing */
    }

    .about-video-slideshow {
        width: 100%;
        height: 500px;
        float: none; /* Reset float on mobile */
        margin: 2rem 0;
    }

    .page-header {
        padding: 4rem 2rem 2rem; /* Tablet: match container padding */
    }

    .page-header h1 {
        font-size: 3rem;
    }

    .section-header h2 {
        font-size: 3rem;
    }

    .slideshow-container {
        height: 350px;
    }

    .team-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-logo {
        width: 120px;
        height: 120px;
        margin-bottom: 2rem;
    }

    .hero {
        min-height: 90vh;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero p {
        font-size: 1.25rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-content,
    .about-content-reverse {
        grid-template-columns: 1fr;
    }
    
    .about-content-reverse .about-text,
    .about-content-reverse .about-image-container {
        order: unset;
    }

    .about-content-wrap {
        padding: 0 1.5rem; /* Mobile: comfortable spacing */
    }

    .about-video-slideshow {
        width: 100%;
        height: 400px;
        border-radius: 1rem;
        float: none; /* Reset float on mobile */
        margin: 2rem 0;
    }

    .youtube-embed-wrapper.float-right {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 2rem 0;
    }

    .page-header {
        padding: 4rem 1.5rem 2rem; /* Mobile: match container padding */
    }

    .page-header h1 {
        font-size: 2.5rem;
        margin-top: 0;
    }

    .section-header h2 {
        font-size: 2.5rem;
    }

    .cta-section h2 {
        font-size: 2.5rem;
    }

    .services-preview,
    .featured-projects,
    .about-preview {
        padding: 5rem 0;
    }

    .slideshow-container {
        height: 300px;
    }

    .slideshow-caption {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }

    .team-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .team-photo {
        width: 120px;
        height: 120px;
    }

    /* Projects slideshow mobile adjustments */
    .projects-slideshow-container {
        height: 350px;
    }

    .slideshow-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .slideshow-prev {
        left: 10px;
    }

    .slideshow-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .about-content-wrap {
        padding: 0 1rem; /* Small mobile: minimum comfortable spacing */
    }

    .page-header {
        padding: 3rem 1rem 2rem; /* Small mobile: minimum spacing */
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .service-card {
        padding: 2rem 1.5rem;
    }

    .slideshow-container {
        height: 250px;
    }

    .slideshow-caption {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* Mobile optimization - ensure video plays properly on mobile */
@media (max-width: 768px) {
    .hero {
        min-height: 80vh; /* Shorter on mobile for better UX */
    }

    .hero-video {
        /* Keep video visible on mobile - uses optimized smaller file */
        width: 100%;
        height: 100%;
        object-fit: cover;
        /* Ensure proper iOS playback */
        -webkit-transform: translate(-50%, -50%);
    }

    /* Stronger overlay on mobile for text readability */
    .hero-overlay {
        background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.20) 0%,
            rgba(248, 249, 250, 0.20) 50%,
            rgba(74, 158, 108, 0.08) 100%
        );
    }
}

/* For very small screens or slow connections - show poster only */
@media (max-width: 480px) and (prefers-reduced-data: reduce) {
    .hero-video {
        display: none;
    }

    .hero {
        background: var(--bg-primary);
    }

    .hero-fallback-image {
        display: block;
    }
}

/* Accessibility - respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .hero-video {
        display: none;
    }
}

/* Tablet/Mobile: Service detail sections - title over image, details below when layout doesn't fit */
@media (max-width: 900px) {
    /* Force single column layout */
    .service-section.about-content,
    .service-section.about-content-reverse {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    .service-section .about-content,
    .service-section .about-content-reverse {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
    }
    
    .service-section .about-text {
        order: 2 !important;
    }
    
    .service-section .about-image-container {
        order: 1 !important;
        position: relative;
        width: 100%;
        height: 250px;
        overflow: hidden;
        border-radius: 1rem;
    }
    
    /* Title overlay over image - show when not in desktop layout */
    .service-title-overlay {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 1.5rem;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7));
        border-radius: 1rem;
        z-index: 2;
        pointer-events: none;
    }
    
    .service-title-overlay h3 {
        margin: 0 !important;
        font-weight: 900;
        font-size: 1.75rem;
        text-align: center;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0px 0px 20px rgba(0, 0, 0, 0.8);
    }
    
    /* Different text colors for mobile */
    .service-title-white h3 {
        color: white;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0px 0px 20px rgba(0, 0, 0, 0.8);
    }
    
    .service-title-black h3 {
        color: black;
        text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.9), 0px 0px 20px rgba(255, 255, 255, 0.8);
    }
    
    .service-title-black {
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.9));
    }
    
    .service-title-green h3 {
        color: var(--accent-green);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0px 0px 20px rgba(0, 0, 0, 0.8);
    }
    
    /* Hide title in text section, show only in overlay */
    .service-section .about-text h3 {
        display: none !important;
    }
}

/* Mobile: Service detail sections - additional mobile-specific styles */
@media (max-width: 768px) {
    /* Ensure image container children fit */
    .service-section .about-image-container > *:not(.service-title-overlay) {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .service-section .about-image-container video,
    .service-section .about-image-container iframe,
    .service-section .about-image-container img {
        border-radius: 1rem;
    }
    
    .service-section .about-text {
        padding: 1rem;
    }
    
    .service-section .about-text p,
    .service-section .about-text ul {
        margin-top: 1rem;
        padding-left: 0;
    }
    
    .service-section .about-features {
        padding-left: 1.5rem !important;
    }
}
