@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:wght@600;700&display=swap');

/* 
   ==============================================
   1. CSS Variables (Based on guidelines.md)
   ==============================================
*/
:root {
    /* Color Palette */
    --primary-blue: #1C2D41;
    --accent-orange: #FF7A59;
    --light-gray-bg: #F4F6F8;
    --medium-gray: #A0AEC0;
    --dark-gray: #4A5568;
    --white: #FFFFFF;

    /* Typography */
    --font-headings: 'Montserrat', sans-serif;
    --font-body: 'Lato', sans-serif;

    /* Layout */
    --container-width: 1140px;
    --padding-section: 6rem 0;
}

/* 
   ==============================================
   2. Base & Reset Styles
   ==============================================
*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--dark-gray);
    background-color: var(--white);
    line-height: 1.6;
    font-size: 16px;
}

/* 
   ==============================================
   3. Typography
   ==============================================
*/
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    color: var(--primary-blue);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--accent-orange);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-blue);
}

/* 
   ==============================================
   4. Layout & Core Components
   ==============================================
*/
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-headings);
    font-weight: 600;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent-orange);
    color: var(--white);
    border-color: var(--accent-orange);
}

.btn-primary:hover {
    background-color: #e66a4f;
    border-color: #e66a4f;
    color: var(--white);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-orange);
    border: 2px solid var(--accent-orange);
}

.btn-secondary:hover {
    background-color: var(--accent-orange);
    color: var(--white);
}

/* 
   ==============================================
   5. Header / Navigation
   ==============================================
*/
.main-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 100;
}

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

.logo {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: var(--white);
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--accent-orange);
}

/* Style for headers on internal pages */
.header-internal {
    position: fixed; /* Sticks the header to the top */
    background-color: var(--primary-blue);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* When the header is internal, ensure the logo and nav links are white */
.header-internal .logo {
    color: var(--white);
}

.header-internal .main-nav a {
    color: var(--white);
}

.header-internal .main-nav a:hover,
.header-internal .main-nav a.active {
    color: var(--accent-orange);
}

/* 
   ==============================================
   6. Hero Section (Homepage)
   ==============================================
*/
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    background: var(--primary-blue); /* Fallback */
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(28, 45, 65, 0.6); /* Darkening overlay */
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
}

.hero-content h1 {
    color: var(--white);
    font-size: 4.5rem;
}

.hero-content .sub-headline {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    font-family: var(--font-body);
}

.hero-content .cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* 
   ==============================================
   7. General Section Styling
   ==============================================
*/
.section {
    padding: var(--padding-section);
}

.section-bg-gray {
    background-color: var(--light-gray-bg);
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* 
   ==============================================
   8. About Page Specifics
   ==============================================
*/
.about-section {
    padding-top: 120px; /* Add padding to offset fixed header if we add one */
}

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

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image img {
    width: 350px;
    height: 350px;
    border-radius: 50%; /* This makes the image a circle */
    object-fit: cover; /* This prevents the image from being distorted */
}

/* 
   ==============================================
   9. Services Page Specifics
   ==============================================
*/
.services-section {
    padding-top: 120px; /* Offset for fixed header */
    background-color: var(--light-gray-bg);
}

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

.service-card {
    background-color: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.service-card h3 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.service-card .service-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-orange);
    margin-bottom: 1.5rem;
}

.service-card ul {
    list-style: none;
    margin-bottom: 2rem;
    flex-grow: 1; /* Pushes the button to the bottom */
}

.service-card ul li {
    margin-bottom: 0.75rem;
    color: var(--dark-gray);
}

/* 
   ==============================================
   10. Contact Page Specifics
   ==============================================
*/
.contact-section {
    padding-top: 120px; /* Offset for fixed header */
}

.form-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    border: 1px solid #e2e8f0;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-family: var(--font-headings);
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 2px rgba(255, 122, 89, 0.2);
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.alternative-contact {
    text-align: center;
    margin-top: 3rem;
    color: var(--dark-gray);
}

/* 
   ==============================================
   11. Portfolio Page Specifics
   ==============================================
*/
.portfolio-section {
    padding-top: 120px; /* Offset for fixed header */
}

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

.portfolio-grid-item {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    aspect-ratio: 9 / 16; /* Forces a square aspect ratio */
}

.portfolio-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.portfolio-grid-item:hover img {
    transform: scale(1.05);
}

/* New styles for project cards on the main portfolio page */
.project-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    color: var(--white);
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(28, 45, 65, 0.8), transparent);
    padding: 2rem 1.5rem 1.5rem;
    font-family: var(--font-headings);
    font-size: 1.5rem;
}

/* 
   ==============================================
   12. Lightbox Styles
   ==============================================
*/
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex; /* Always a flex container */
    justify-content: center;
    align-items: center;
    opacity: 0; /* Hidden by default */
    visibility: hidden; /* Hidden by default */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#lightbox.visible {
    opacity: 1;
    visibility: visible;
}

#lightbox-img {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: var(--white);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001; /* Ensure close button is on top of the image */
}

.lightbox-close:hover {
    color: var(--accent-orange);
}

/* 
   ==============================================
   13. Testimonials Section
   ==============================================
*/
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background-color: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 8px;
    border-top: 4px solid var(--accent-orange);
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}

.testimonial-card p {
    font-style: italic;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
}

.testimonial-card cite {
    display: block;
    text-align: right;
    font-weight: 700;
    color: var(--primary-blue);
    font-style: normal;
}

.testimonial-card cite::before {
    content: "— ";
}

/* 
   ==============================================
   14. Responsive & Mobile Styles
   ==============================================
*/

.nav-toggle {
    display: none; /* Hidden on desktop */
    padding: .5em;
    background: transparent;
    border: 0;
    cursor: pointer;
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    z-index: 1001;
}

.hamburger {
    display: block;
    position: relative;
    background: var(--white);
    width: 2em;
    height: 3px;
    transition: transform 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    background: var(--white);
    height: 3px;
    transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

/* Animate hamburger to an 'X' when nav is open */
.nav-open .hamburger {
    transform: rotate(.625turn);
}

.nav-open .hamburger::before {
    top: 0;
    transform: rotate(90deg);
}

.nav-open .hamburger::after {
    bottom: 0;
    opacity: 0;
}


@media (max-width: 992px) {
    .nav-toggle {
        display: block; /* Show hamburger on mobile */
    }

    .main-nav {
        position: fixed;
        background: var(--primary-blue);
        color: var(--white);
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        
        /* Hide the nav off-screen by default */
        transform: translateX(100%);
        transition: transform 250ms cubic-bezier(.5, 0, .5, 1);
    }

    .main-nav ul {
        list-style: none;
        display: flex;
        height: 100%;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: center;
        margin: 0;
        padding: 0;
    }

    .main-nav a {
        font-size: 1.5rem;
    }

    /* Show the nav when the body has the .nav-open class */
    .nav-open .main-nav {
        transform: translateX(0);
    }

    /* Adjust hero section for mobile */
    .hero-content h1 {
        font-size: 2.5rem;
    }

    /* Adjust grid layouts to stack vertically */
    .about-content,
    .services-grid,
    .testimonials-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .about-content {
        text-align: center;
    }

    .about-image img {
        width: 250px;
        height: 250px;
        margin-bottom: 2rem;
    }
}