*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;
    overflow-x: hidden; 
    width: 100%;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    color: #404040;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    color: #ffffff
}


.top-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    color: #ffffff;
    margin-top: 200px
}

header {
    background-color: transparent;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 1s ease-in-out;
}

header.hidden {
    transform: translateY(-100%);
}

.otsikko {
    color: #000000;
    text-decoration: none;
}

.small-text {
    font-size: 0.7em;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
    color: #000;
    display: flex;
    align-items: center;
    min-width: 150px;
    margin-right: 20px;
}

.logo-icon {
    height: 60px;
    align-self: center;
}

.icon {
    height: 100px;
    margin-right: 10px;
}

.logo-font {
    height: 60px;
    margin-right: 10px;
}

nav {
    flex-grow: 1;
    text-align: right;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    padding-bottom: 5px;
    transition: color 0.3s ease, border-color 0.3s ease;
    white-space: nowrap;
}


nav ul li a.active {
    border-bottom: 2px solid #ffffff;
    color: #000;
}

nav ul li a:hover {
    color: #000;
    border-color: #000;
}

.hero-section {
    position: relative;
    color: #404040;
    text-align: center;
    padding: 100px 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -1;
    transform: translate(-50%, -50%);
    background-size: cover;
}

.hero-content {
    padding: 30px 40px;
    border-radius: 8px;
    position: relative;
    margin-top: 150px;
    z-index: 1;
    max-width: 90%;
}

.hero-section h1 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    word-break: break-word;
    color: #ddd
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #404040;
    color: #ffffff;
    text-decoration: none;
    border-radius: 15px;
    font-weight: 700;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 0.95em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.searchbtn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #404040;
    color: #404040;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 1px solid #ccc;
}

.btn:hover {
    background-color: #f0f0f0;
    color: #404040;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.btn-dark {
    background-color: #000000;
    color: #ddd;
}

.btn-dark:hover {
    background-color: #f0f0f0;
    color: #404040;
}


.about-section {
    text-align: center;
    padding: 60px 20px;
    background-color: #404040;
}

.about-section p {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto 30px auto;
    color: #ffffff;
    word-wrap: break-word;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 40px auto;
    max-width: 900px;
    padding: 0 10px;
    box-sizing: border-box;
    background-color: transparent;
}

.image-gallery h3{
    font-size: 1.8em;
    color: #000000;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.contact-section {
    padding: 5px 5px;
    text-align:center;
    background-color: #404040;
}

.contact-section h2 {
    font-size: 2.5em;
    color: #000000;
    margin-bottom: 20px;
}

.maintenance-section {
    padding: 300px 20px 0px;
    text-align: center;
    background-image: url("../images/new_background.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.gallery-contact-section {
    padding: 300px 20px 30px;
    text-align: center;
    background-image: url("../images/Terassi_bg.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Dark background */
}

.gallery-contact-section h2 {
    font-size: 2.5em;
    color: #fff; /* White heading */
    margin-bottom: 20px;
}

.gallery-contact-section p {
    font-size: 1.1em;
    max-width: 1000px;
    margin: 0 auto 40px auto;
    color: #ccc; /* Light gray text */
}

.gallery-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-img:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.btncenter {
    display: inline-block;
    padding: 12px 25px;
    background-color: #404040;
    color: #000000;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid #ccc;
    align-self: center;
}

footer {
    background-color: #000000;
    color: #404040;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

.content-section {
    padding: 20px 20px;
    background-image: url("../images/deck_background.png");
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
}

.intro-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
}

.intro-text {
    flex: 1;
    min-width: 300px;
    text-align: left;
}

.intro-text h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #ffc20d;
    font-weight: 700;
    line-height: 1.2;
}

.intro-text p {
    font-size: 1.1em;
    color: #ffffff;
    margin-bottom: 20px;
    line-height: 1.6;
}

.highlight-box {
    border-left: 5px solid #000000;
    padding: 20px;
    margin-top: 30px;
}

.highlight-box h3 {
    margin: 0 0 5px 0;
    font-size: 1.5em;
    color: #ffc20d;
}

.intro-image {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro-image img {
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.intro-image img:hover {
    transform: scale(1.02);
}

.process-section {
    background-image: url("../images/Terassi_tausta_placeholder.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 80px 20px;
    text-align: center;
    position: relative;
}


.process-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 0;
}

.process-section .container {
    position: relative;
    z-index: 1;
}

.process-section h2 {
    font-size: 2.2em;
    margin-bottom: 50px;
    color: #404040;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background-image: url("../images/Terassi_bg.png");
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    padding: 40px 30px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.service-card .step-number {
    font-size: 3em;
    font-weight: 800;
    color: #e0e0e0;
    margin-bottom: 10px;
    display: block;
}

.service-card h3 {
    font-size: 1.4em;
    margin-bottom: 15px;
    color: #000000;
}

.service-card p {
    color: #ffffff;
    font-size: 1em;
}

.lower-hero {
    background-image: url("../images/Terassi_tausta_placeholder.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 120px 20px;
    color: #404040;
    text-align: center;
    position: relative;
    margin-top: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.lower-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
}

.lower-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}


.lower-content p {
    font-size: 1.2em;
    margin-bottom: 40px;
    opacity: 0.9;
    color: #ddd;
}

.cta-button {
    display: inline-block;
    padding: 18px 45px;
    background-color: #404040;
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.cta-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    color: #404040;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 15px;
        flex-direction: column;
    }

    nav ul li {
        margin: 5px 0;
    }

    .hero-section h1 {
        font-size: 2em;
    }

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

    .about-section p {
        font-size: 1em;
    }

    .image-gallery {
        grid-template-columns: 1fr;
        max-width: 400px;
        background-color: transparent;
    }

    .intro-container {
        flex-direction: column;
    }
    
    .intro-text, .intro-image {
        width: 100%;
        min-width: 0; 
    }
    
    .lower-hero h2 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.8em;
    }

    .hero-content {
        padding: 15px 20px;
    }

    .logo {
        font-size: 1.3em;
    }

    nav ul li a {
        font-size: 0.9em;
    }
}

header.transparent-header {
    background-color: transparent;
    border-bottom: none;
    box-shadow: none;
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease-in-out, background-color 0.3s ease, box-shadow 0.3s ease;
}

header.transparent-header.hidden {
    transform: translateY(-100%);
}

header.transparent-header:not(.scrolled) nav ul li a,
header.transparent-header:not(.scrolled) .otsikko {
    color: #ffffff;
    font: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

header.transparent-header:not(.scrolled) nav ul li a.active {
    border-bottom-color: #ffffff;
    color: #ffffff;
}

header.transparent-header:not(.scrolled) nav ul li a:hover {
    color: #000000;
    border-color: #000000;
}

header.transparent-header.scrolled {
    background-color: #404040;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


.process-section {
    background-image: url('../images/Terassi_tausta_placeholder.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 80px 20px;
    text-align: center;
    position: relative;
    color: #404040;
}

.process-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1;
}

.process-section .container {
    position: relative;
    z-index: 2;
}

.process-section h2 {
    font-size: 2.2em;
    margin-bottom: 50px;
    color: #dddddd;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.lower-hero {
    background-image: url('../images/Terassi_tausta_placeholder.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 120px 20px;
    color: #404040;
    text-align: center;
    position: relative;
    margin-top: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.lower-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1;
}

.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}