{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    /*--accent: #e21f22;*/
    --accent: #e31e25;
    --light: #f1f1f1;
    /* --gray: #6c757d; */
    --gray: #727270;
    --white: #ffffff;
}

body {
    /* font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
    font-family: "Sora", sans-serif;
    color: var(--primary);
    /*line-height: 1.6;*/
    overflow-x: hidden;
    /* background: var(--white); */
    background: #d9dbda;
    margin: 0; /* Ensure no margin */
    padding: 0; /* Ensure no padding */
    
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--white);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    height: 85px;
    width: auto;
}

.logo span {
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    background: var(--white);
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    font-size: 0.95rem;
}

.has-submenu > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.has-submenu > a::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.has-submenu:hover > a::after,
.has-submenu:focus-within > a::after {
    transform: rotate(225deg);
}

.submenu {
    list-style: none;
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--white);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    min-width: 220px;
}

.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu {
    display: flex;
}

.submenu a {
    white-space: nowrap;
    display: block;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--accent);
}

.nav-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.burger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    background: transparent;
    border: none;
}

.burger span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    transition: 0.3s;
}

.burger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;    
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light);
    overflow: hidden;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-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;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(26, 26, 46, 0.45);
}

.hero-slide.active {
    opacity: 1;
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    padding: 0;
}

.dot.active {
    background: var(--accent);
    transform: scale(1.2);
    border-color: var(--white);
}

.dot:hover,
.dot:focus-visible {
    background: rgba(255, 255, 255, 0.8);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    animation: fadeInUp 1s ease;
}

.hero h1 {
    font-size: clamp(3.5rem, 5vw, 4.5rem);
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.4rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--accent);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(226, 31, 34, 0.3);
}

.cta-button:hover,
.cta-button:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(226, 31, 34, 0.5);
}

.cta-button:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 4px;
}

/* Sections */
section {
    padding: 5rem 2rem;
    max-width: 1200px;
    /* margin: 0 auto; */
    margin-left: auto;
    margin-right: auto;
    margin-top: 40px;
    margin-bottom: 40px;
    background: white;
    /* background-color: #d9dbda; */
    /* background-color: #b2b4b3; */
    /* background-color: #727270; */

    

    box-shadow: 10px 10px 21px 1px rgba(0,0,0,0.5);

    

}

section.hero {
    max-width: none;
    padding: 0;
    margin: 0;
}

/* section:nth-of-type(even) {
    background: var(--white);
    
} */

h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 3rem;
    text-align: center;
    color: var(--primary);
    position: relative;
}

h2::after {
    content: '';
    display: block;
    /*width: 480px;*/
    width: 100%;
    max-width: 600px;
    height: 6px;
    /* background: var(--accent); */
    background: #e31e25;
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* Services Grid */
.services-grid {
    /*display: grid;*/
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    color: var(--gray);
}

.intro-text {
    max-width: 800px;
    /* margin: 0 auto; */
    margin-left:auto;
    margin-right: auto;
    text-align: center;
    color: var(--gray);
    /* font-size: 1.1rem;
    line-height: 1.8; */
    /*display: grid;
    gap: 1.5rem;*/
}

.intro-text img{
    display: inline-block;
    max-width: 100%;
    border-width: 2px;
    border-style: solid;
    /* border-color: #e31e25; */
    /* border-color: #d9dbda; */
    border-color: #b2b4b3;
    border-radius:  8px;   
}

.intro-text h3::after {
    content: '';
    display: block;
    /*width: 480px;*/
    width: 100%;
    max-width: 350px;
    height: 6px;
    /* background: #b2b4b3; */
    background: rgba(72, 72, 70, 0.25);
    /* background: #727270; */
    margin: 1rem auto 0;
    border-radius: 2px;
}

.service-card {
    /* background: var(--accent); */
    /* background: var(--white); */
    background: rgba(72, 72, 70, 0.1);
    padding: 2rem;
    border-radius: 15px;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); */
    box-shadow: 0px 2.5px 5px 5px rgba(227,30,37,0.25);
    transition: transform 0.3s, box-shadow 0.3s;
    /* border-top: 4px solid var(--white); */
    /* border: 3px solid var(--accent); */
    /* color: var(--white); */
    color: var(--primary);
    min-height: 240px;
    margin-bottom: 20px;
}

.service-card-images-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.service-card-image {
    /* width: 100%;
    overflow: hidden;
    border-radius: 8px;
    padding: 5px; */
    width: 100%;
    overflow: visible; /* Changed from hidden */
    border-radius: 8px;
    /* display: flex; */
    align-items: center;
    justify-content: center;
}

.service-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border-width: 2px;
    border-style: solid;
    /* border-color: #d9dbda; */
    border-color: #b2b4b3;
    display: block;
    box-sizing: border-box; /* Include border in width calculation */
}


/* .service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
} */

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-card p {
    line-height: 1.8;
    opacity: 0.95;
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
    
}

.feature {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    /* background: rgba(22, 33, 62, 0.03); */
    background: rgba(72, 72, 70, 0.1);
    border: 1px solid rgba(22, 33, 62, 0.08);
    box-shadow: 0px 2.5px 5px 5px rgba(227,30,37,0.25);
}

.feature-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.feature p {
    color: var(--gray);
}

/* PDF Lightbox Trigger */
.pdf-lightbox-trigger {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.pdf-lightbox-trigger:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.pdf-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
}

.pdf-lightbox-trigger:hover .pdf-overlay {
    opacity: 1;
}

.pdf-icon {
    font-size: 1.5rem;
}

.pdf-text {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Lightbox Modal */
.pdf-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.pdf-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-lightbox-content {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.pdf-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.pdf-lightbox-close:hover {
    transform: scale(1.2);
}

#pdf-viewer {
    width: 100%;
    height: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}




/* Machine Grid */
.machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.machine-card {
     /* background-color: #d9dbda; */
    /* background-color: #b2b4b3; */
    /* background-color: #727270; */
    background: rgba(72, 72, 70, 0.1);
    box-shadow: 0px 2.5px 5px 5px rgba(227,30,37,0.25);
    /* background: var(--accent); */
    /*padding: 1rem;*/
    padding-bottom: 1rem;
    border-radius: 15px;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); */
    transition: transform 0.3s, box-shadow 0.3s;
    /* border-top: 4px solid var(--white); */
    color: var(--gray);
    min-height: 240px;
    /*NEU*/
    display: flex;
    flex-direction: column;
    max-width: 400px;
    margin: 0 auto;
}

.machine-card-image {
    width: 100%;
    /*height: 350px;*/
    border-radius: 15px;
    overflow: hidden;
    /*margin: 0 auto 1rem auto;*/
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0px;
}

.machine-card img {
    max-width: calc(100% - 20px); /* Account for padding */
    max-height: calc(100% - 20px);
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    object-position: center;
    border-radius: 15px;
    border-color: #b2b4b3;
    border-width: 2px;
    border-style: solid;
}
.machine-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.machine-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    text-align: center;
    color: var(--primary);
    /* text-shadow: 2px 2px 2px rgba(227,30,37,0.25); */
}

.machine-card p {
    /*line-height: 1.8;*/
    text-align: left;
    opacity: 0.95;
    font-size: 14px;
    margin: 0 auto;
    max-width: fit-content;
    

}

.machine-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#machine-h3::after{
    content: '';
    display: block;
    /*width: 480px;*/
    width: 100%;
    max-width: 350px;
    height: 6px;
    /* background: #b2b4b3; */
    background: rgba(72, 72, 70, 0.25);
    /* background: #727270; */
    margin: 1rem auto 0;
    border-radius: 2px;

}

/* Contact */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    background: var(--white);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.contact-item {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    /* background: rgba(22, 33, 62, 0.03); */
    background: rgba(72, 72, 70, 0.1);
    border: 1px solid rgba(22, 33, 62, 0.08);
}

.contact-item h3 {
    /*color: var(--accent);*/
    color: var(--primary);
    margin-bottom: 1rem;
}

.contact-item p {
    color: var(--gray);
    font-size: 13px;
}

.projects-grid,
.references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.project-card,
.reference-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.project-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

#projects-h3::after{
    content: '';
    display: block;
    /*width: 480px;*/
    width: 100%;
    max-width: 350px;
    height: 6px;
    /* background: #b2b4b3; */
    background: rgba(72, 72, 70, 0.25);
    /* background: #727270; */
    margin: 1rem auto 0;
    border-radius: 2px;

}

.project-card p {
    color: var(--gray);
}

.reference-quote {
    font-style: italic;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.reference-meta {
    color: var(--gray);
    font-weight: 500;
}

/* Footer */
footer {
    /*background: var(--white);*/
    /* background-color: #d9dbda; */
    background-color: #b2b4b3;
    /* background-color: #727270; */
    color: var(--primary);
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid #e0e0e0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--accent);
}

.footer-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

footer p {
    margin-top: 0.5rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet and Mobile Navigation */
@media (max-width: 1024px) {
    .burger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 80px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: right 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 1rem 0;
    }

    .nav-links a {
        font-size: 1.1rem;
    }
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hero {
        min-height: 500px;
    }

    .logo img {
        height: 75px;
    }

    .nav-container {
        padding: 1rem 1.5rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 80px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        right: 0;
    }

    .has-submenu {
        width: 100%;
    }

    .has-submenu > a::after,
    .has-submenu:hover > a::after,
    .has-submenu:focus-within > a::after {
        transform: rotate(45deg);
    }

    .submenu {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
        background: transparent;
        box-shadow: none;
        padding: 0.5rem 0 0;
        gap: 0.5rem;
        min-width: 0;
    }

    .burger {
        display: flex;
    }

    .burger.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .burger.active span:nth-child(2) {
        opacity: 0;
    }

    .burger.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    section {
        padding: 3.5rem 1.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid,
    .references-grid {
        grid-template-columns: 1fr;
    }

    .service-card-images-row {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    .service-card-image img {
        height: 250px; /* Slightly taller for better mobile viewing */
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 1rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.05rem;
    }

    .cta-button {
        padding: 0.8rem 2rem;
        font-size: 0.95rem;
    }

    .service-card-images-row {
        gap: 1rem;
    }
    
    .service-card-image img {
        height: 200px;
    }
}





/* Base state - hidden before animation */
.scroll-animate,
.scroll-animate-slow,
.scroll-animate-fast,
.scroll-animate-small,
.scroll-animate-large,
.scroll-animate-left,
.scroll-animate-right,
.scroll-animate-fade,
.scroll-animate-scale {
    opacity: 0;
    transition: all 0.8s ease-out;
}

/* Standard slide from bottom */
.scroll-animate {
    transform: translateY(50px);
}

.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Slow animation */
.scroll-animate-slow {
    transform: translateY(50px);
    transition-duration: 1.5s;
}

.scroll-animate-slow.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Fast animation */
.scroll-animate-fast {
    transform: translateY(50px);
    transition-duration: 0.4s;
}

.scroll-animate-fast.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Small movement */
.scroll-animate-small {
    transform: translateY(20px);
}

.scroll-animate-small.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Large movement */
.scroll-animate-large {
    transform: translateY(100px);
}

.scroll-animate-large.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Slide from left */
.scroll-animate-left {
    transform: translateX(-50px);
}

.scroll-animate-left.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* Slide from right */
.scroll-animate-right {
    transform: translateX(50px);
}

.scroll-animate-right.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* Fade only */
.scroll-animate-fade {
    transform: none;
}

.scroll-animate-fade.animate-in {
    opacity: 1;
}

/* Scale up */
.scroll-animate-scale {
    transform: scale(0.8);
}

.scroll-animate-scale.animate-in {
    opacity: 1;
    transform: scale(1);
}

/* Delay variations */
.scroll-animate-delay-1 {
    transition-delay: 0.2s;
}

.scroll-animate-delay-2 {
    transition-delay: 0.4s;
}

.scroll-animate-delay-3 {
    transition-delay: 0.6s;
}

.scroll-animate-delay-4 {
    transition-delay: 0.8s;
}

/* Background Image Parallax Effect for Sections */
section#kompetenzen {
    position: relative;
    overflow: hidden;
}

section#kompetenzen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/background/bkgr01.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.05;
    z-index: -1;
    transition: opacity 0.5s ease;
}

section#kompetenzen.animate-in::before {
    opacity: 0.08;
}

section#maschinenpark {
    position: relative;
    overflow: hidden;
}

section#maschinenpark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/background/bkgr03.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.05;
    z-index: -1;
    transition: opacity 0.5s ease;
}

section#maschinenpark.animate-in::before {
    opacity: 0.08;
}

section#projekte {
    position: relative;
    overflow: hidden;
}

section#projekte::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/background/bkgr05.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.05;
    z-index: -1;
    transition: opacity 0.5s ease;
}

section#projekte.animate-in::before {
    opacity: 0.08;
}


/* Icon Animation for Service Cards */
.service-icon {
    transition: transform 0.3s ease;
}

.service-card.animate-in .service-icon {
    animation: bounceIn 0.8s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Feature Number Animation */
.feature-number {
    transition: transform 0.3s ease;
}

.feature.animate-in .feature-number {
    animation: rotateIn 0.8s ease;
}

@keyframes rotateIn {
    0% {
        transform: rotate(-180deg) scale(0);
        opacity: 0;
    }
    100% {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

/* Heading Animation */
h2 {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

section.animate-in h2 {
    opacity: 1;
    transform: translateY(0);
}

h2::after {
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.8s ease 0.3s;
}

section.animate-in h2::after {
    transform: scaleX(1);
}



/* Replace the mobile media query section at the end with this: */
@media (max-width: 768px) {
    /* Simplify animations on mobile for better performance */
    .scroll-animate,
    .scroll-animate-card,
    .scroll-animate-feature {
        /* Keep simple fade-in, remove complex transforms */
        opacity: 0;
        transform: translateY(20px) !important; /* Reduced movement */
        transition: opacity 0.5s ease, transform 0.5s ease !important; /* Faster */
    }
    
    .scroll-animate.animate-in,
    .scroll-animate-card.animate-in,
    .scroll-animate-feature.animate-in {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    
    /* Disable parallax on mobile - use scroll instead of fixed */
    section#kompetenzen::before,
    section#maschinenpark::before,
    section#projekte::before {
        background-attachment: scroll !important;
        opacity: 0.15 !important;
    }
    
    /* Disable complex keyframe animations on mobile */
    .service-card.animate-in .service-icon {
        animation: none !important;
    }
    
    .feature.animate-in .feature-number {
        animation: none !important;
    }
    
    /* Ensure machine grid displays properly */
    .machine-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
    
    /* Ensure sections are visible */
    section {
        opacity: 1;
    }

    .pdf-previews {
        grid-template-columns: 1fr;
    }
    
    .pdf-preview img {
        height: 250px;
    }
}

/* For very small screens, disable all animations */
@media (max-width: 480px) {
    .scroll-animate,
    .scroll-animate-card,
    .scroll-animate-feature {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}