﻿/* ==============================================
   MAX-D Engineering Services — Main Stylesheet
   ============================================== */

/* --- Global Layout --- */
body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

/* --- Header --- */
header {
    background-color: #f8f9fb;
    border-bottom: 3px solid #0074cc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75em 5%;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

    header h1 {
        margin: 0;
        font-family: "BankGothic Md BT", Arial, sans-serif;
        font-size: 1.8rem;
        color: #0074cc;
    }

/* --- Navigation --- */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1em;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: color 0.2s;
}

    nav a:hover {
        color: #0074cc;
    }

/* --- Hero Section (background + wireframe + text box) --- */
.hero {
    position: relative;
    height: 100vh;
    background: url("/images/Refinery.jpg") center center / cover no-repeat;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 3% 0 0 3%; /* space from top-left */
    color: white;
    opacity: 0;
    animation: fadeInHero 1.2s ease-out forwards;
}

    /* --- Blueprint overlay (right half) --- */
    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to right, rgba(0,0,0,0) 48%, rgba(5,35,80,0.9) 100%);
        mix-blend-mode: multiply;
        z-index: 1;
        pointer-events: none;
    }

    .hero::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: repeating-linear-gradient(to right, rgba(120,200,255,0.35) 0 1px, transparent 1px 25px), repeating-linear-gradient(to bottom, rgba(120,200,255,0.35) 0 1px, transparent 1px 25px);
        background-size: 25px 25px;
        mask-image: linear-gradient(to right, transparent 48%, black 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 48%, black 100%);
        mix-blend-mode: screen;
        filter: drop-shadow(0 0 3px rgba(120,200,255,0.8)) drop-shadow(0 0 6px rgba(120,200,255,0.5));
        pointer-events: none;
        z-index: 2;
    }

/* --- Text Box (upper-left corner, dynamic size, brand blue) --- */
.hero-text {
    position: relative;
    background: rgba(0, 116, 204, 0.9); /* corporate blue, 90% opaque */
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 1.2em 1.6em;
    color: #fff;
    font-size: 1.05rem;
    line-height: 1.4;
    z-index: 3;
    box-shadow: 0 0 10px rgba(0,0,0,0.25);
    display: inline-block; /* shrink to fit text */
    width: auto;
    height: auto;
    max-width: 380px; /* prevent overly wide boxes on big screens */
    /* Animation (runs once) */
    opacity: 0;
    transform: translateX(-40px);
    animation: slideFadeIn 1.4s ease-out forwards;
    animation-delay: 0.5s;
}


/* --- Animations --- */
@keyframes fadeInHero {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideFadeIn {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Main Content --- */
main {
    max-width: 1100px;
    margin: 2em auto;
    padding: 0 1em;
}

    main h2 {
        color: #0074cc;
        text-align: center;
    }

.intro {
    text-align: center;
    margin-bottom: 2em;
}

/* --- Services Section --- */
.services {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 1.5em;
}

.service {
    flex: 1 1 300px;
    background: #f4f7fa;
    border: 1px solid #dce2e8;
    border-radius: 8px;
    padding: 1.5em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    opacity: 0;
    animation: fadeInUp 0.9s ease-out forwards;
}

    .service:hover {
        transform: translateY(-5px);
    }

    .service:nth-child(1) {
        animation-delay: 0.3s;
    }

    .service:nth-child(2) {
        animation-delay: 0.5s;
    }

    .service:nth-child(3) {
        animation-delay: 0.7s;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Project & Contact Layouts --- */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5em;
}

.project {
    background: #f4f7fa;
    border: 1px solid #dce2e8;
    border-radius: 8px;
    padding: 1em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .project h3 {
        color: #0074cc;
    }

form {
    display: flex;
    flex-direction: column;
    gap: 1em;
    background: #f4f7fa;
    border: 1px solid #dce2e8;
    border-radius: 8px;
    padding: 1.5em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

label {
    font-weight: bold;
}

input, textarea {
    padding: 0.6em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

textarea {
    resize: vertical;
    height: 120px;
}

button {
    background: #0074cc;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.8em;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

    button:hover {
        background: #005fa3;
    }

/* --- Footer --- */
footer {
    background-color: #f8f9fb;
    border-top: 2px solid #0074cc;
    text-align: center;
    padding: 1em 0;
    font-size: 0.9rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 800px) {
    .hero {
        height: 80vh;
        background-size: contain;
        background-color: #000;
        justify-content: center;
        padding: 4% 0;
    }

    .hero-text {
        width: 85%;
        height: auto;
        text-align: center;
        padding: 1em;
        transform: translateX(0);
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
    }

    .services {
        flex-direction: column;
        align-items: center;
    }

    .service {
        width: 100%;
    }
}
