/* Base styles and reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #111111;
    --secondary-color: #b24c32;
    --accent-color: #b24c32;
    --text-color: #000000;
    --text-light: #faf9f6;
    --bg-light: #faf9f6;
    --bg-dark: #111111;
    --font-main: 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Keep responsive picture sources layout-neutral around the existing images. */
picture {
    display: contents;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

section {
    padding: 100px 0;
    background-color: var(--bg-light);
}

.btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: #faf9f6;
    padding: 12px 30px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #8a3a26;
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-light);
    box-shadow: var(--shadow);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 50px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
    transition: var(--transition);
}

.logo a:hover img {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    justify-content: space-between;
    width: 40%;
}

.nav-links li a {
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.nav-links li a:hover::after {
    width: 100%;
}

.burger {
    display: none;
    cursor: pointer;
    border: 0;
    background: transparent;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px;
    transition: var(--transition);
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    color: var(--text-light);
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-bg-1 {
    background-image: url('../images/hero-bg-2.png');
    background-image: image-set(
        url('../images/hero-bg-2.png.webp') type('image/webp'),
        url('../images/hero-bg-2.png') type('image/png')
    );
    opacity: 1;
}

.hero-bg-2 {
    background-image: url('../images/hero-bg-3.png');
    background-image: image-set(
        url('../images/hero-bg-3.png.webp') type('image/webp'),
        url('../images/hero-bg-3.png') type('image/png')
    );
}

.hero-bg-3 {
    background-image: url('../images/hero-bg-1.png');
    background-image: image-set(
        url('../images/hero-bg-1.png.webp') type('image/webp'),
        url('../images/hero-bg-1.png') type('image/png')
    );
}

.hero-bg-4 {
    background-image: url('../images/hero-bg-4.png');
    background-image: image-set(
        url('../images/hero-bg-4.png.webp') type('image/webp'),
        url('../images/hero-bg-4.png') type('image/png')
    );
}

.hero-content {
    max-width: 800px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.about-text p {
    margin-bottom: 1rem;
}

/* Projects Section */
.project-filter {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    margin: 0 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
}

.filter-btn.active, .filter-btn:hover {
    color: var(--secondary-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.project-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

/* Image loading optimization */
.project-card img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.project-card img[loading="lazy"].loaded,
.project-card img:not([loading="lazy"]) {
    opacity: 1;
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-info {
    padding: 20px;
    background-color: var(--bg-light);
}

.project-info h3 {
    margin-bottom: 0.5rem;
}

.project-info p {
    margin-bottom: 1rem;
    color: #666666;
}

/* Services Section */
#services {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

#services h2::after {
    background-color: var(--accent-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 8px;
    transition: var(--transition);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 255, 255, 0.1);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
}

.service-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.service-card h3 {
    margin-bottom: 1rem;
}

/* Contact Section */
#contact {
    background: #fbfaf7;
}

.contact-container {
    max-width: 1040px;
}

.contact-content {
    display: grid;
    grid-template-columns: minmax(0, 570px) minmax(240px, 1fr);
    gap: clamp(60px, 9vw, 110px);
    align-items: center;
    justify-content: center;
}

.contact-form-panel {
    width: 100%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.form-field {
    position: relative;
    margin-bottom: 10px;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 50px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.98rem;
    color: var(--text-color);
    background-color: #dedede;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #787878;
    opacity: 1;
}

.form-field select {
    color: #787878;
    cursor: pointer;
}

.form-field select:valid {
    color: var(--text-color);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    background-color: #e6e6e6;
    box-shadow: 0 0 0 3px rgba(178, 76, 50, 0.16);
}

.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
    border-color: #b42318;
    background-color: #fff3f2;
}

.form-field textarea {
    resize: vertical;
    min-height: 165px;
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-row--service {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
}

.form-divider {
    width: 27px;
    height: 3px;
    margin: 7px auto 18px;
    background-color: var(--secondary-color);
}

.form-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-form {
    position: relative;
}

.form-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: start;
    margin-top: 12px;
}

.form-consent {
    min-width: 0;
}

.form-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
}

.form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.form-required {
    margin-top: 5px;
    color: #555555;
    font-size: 0.78rem;
    font-style: italic;
}

.form-privacy {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
    font-size: 0.88rem;
    line-height: 1.4;
}

.form-privacy input {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    accent-color: var(--secondary-color);
    flex: 0 0 auto;
}

.form-privacy input[aria-invalid="true"] {
    outline: 2px solid #b42318;
    outline-offset: 2px;
}

.form-privacy-link {
    color: var(--secondary-color);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.form-privacy-link:hover,
.form-privacy-link:focus-visible {
    color: #8a3a26;
}

.form-error {
    display: block;
    color: #b42318;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.form-error:not(:empty) {
    padding: 4px 5px 1px;
}

.form-status {
    min-height: 1.5rem;
    margin-top: 13px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
}

.form-status--success {
    color: #247a3d;
}

.form-status--error {
    color: #b42318;
}

.contact-form[aria-busy="true"] {
    opacity: 0.78;
}

.contact-form button:disabled {
    cursor: wait;
}

.contact-info {
    justify-self: start;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1rem;
    font-weight: 600;
}

.info-item .icon {
    width: 46px;
    height: 46px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #faf9f6;
    margin-right: 13px;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.info-item a:hover,
.info-item a:focus-visible {
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    margin-top: 2rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #faf9f6;
    margin-right: 1rem;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

.contact-socials {
    margin-top: 26px;
}

.contact-socials a {
    width: 38px;
    height: 38px;
    margin-right: 12px;
    font-size: 1rem;
}

/* Privacy page */
.privacy-page main {
    padding-top: 80px;
}

.privacy-hero {
    padding: 90px 0 55px;
    color: var(--text-light);
    text-align: center;
    background: var(--bg-dark);
}

.privacy-hero h1 {
    margin-bottom: 0.75rem;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
}

.privacy-hero p {
    color: rgba(250, 249, 246, 0.78);
}

.privacy-content {
    padding: 70px 0 100px;
}

.privacy-article {
    max-width: 840px;
    margin: 0 auto;
}

.privacy-article > p,
.privacy-article li {
    color: #333333;
}

.privacy-article h2 {
    margin: 2.75rem 0 1rem;
    padding: 0;
    font-size: 1.45rem;
    text-align: left;
}

.privacy-article h2:first-of-type {
    margin-top: 2rem;
}

.privacy-article h2::after {
    display: none;
}

.privacy-article p + p {
    margin-top: 1rem;
}

.privacy-article ul {
    margin: 1rem 0 0 1.25rem;
    list-style: disc;
}

.privacy-article li + li {
    margin-top: 0.45rem;
}

.privacy-article a {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.privacy-article a:hover,
.privacy-article a:focus-visible {
    color: #8a3a26;
}

.privacy-contact {
    margin-top: 1rem;
    padding: 1.25rem;
    border-left: 4px solid var(--secondary-color);
    background: #f0eee9;
}

.privacy-back {
    margin-top: 3rem;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 80px;
    margin-bottom: 50px;
    align-items: stretch;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
}

.footer-logo img {
    max-width: 280px;
    height: auto;
}

.footer-logo .lre-logo {
    max-width: 180px !important;
    height: auto;
}

.footer-logo a:last-child {
    margin-top: 1.5rem;
}

.footer-logo p {
    margin-top: 1rem;
}

.footer-links h3, .footer-newsletter h3, .footer-contact h3 {
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-links h3::after, .footer-newsletter h3::after, .footer-contact h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--secondary-color);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-contact p {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.footer-contact p i {
    margin-right: 10px;
    width: 16px;
    color: var(--secondary-color);
}

.footer-contact p a {
    display: flex;
    align-items: center;
}

.footer-contact p a:hover,
.footer-contact p a:focus-visible {
    color: var(--secondary-color);
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.footer-newsletter form {
    display: flex;
}

.footer-newsletter input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-family: inherit;
}

.footer-newsletter button {
    border-radius: 0 4px 4px 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    text-align: center;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .nav-links {
        width: 60%;
    }
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: 0;
        height: calc(100vh - 80px);
        top: 80px;
        background-color: rgba(255, 255, 255, 0.95);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-around;
        width: 50%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -5px 0 10px rgba(0, 0, 0, 0.1);
    }

    .nav-active {
        transform: translateX(0%);
    }

    .burger {
        display: block;
    }
    
    .logo img {
        height: 40px;
    }

    .about-content, .contact-content {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        padding-left: 0;
        justify-self: center;
    }

    .contact-content {
        gap: 50px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        justify-items: center;
    }
    
    .footer-logo, .footer-contact {
        align-items: center;
        justify-self: center;
        text-align: center;
    }

    .footer-logo a:last-child {
        margin-top: 40px;
    }
    
    .footer-links {
        justify-self: center;
        text-align: center;
    }
    
    /* Center the grey bars under titles on mobile */
    .footer-links h3::after, 
    .footer-newsletter h3::after, 
    .footer-contact h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .about-image::before {
        display: none;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}

@media screen and (max-width: 480px) {
    .nav-links {
        width: 100%;
    }
    
    .logo img {
        height: 35px;
    }
    
    nav {
        padding: 0 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-actions {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-btn {
        width: 100%;
    }

    .contact-info {
        width: 100%;
    }

    .info-item {
        justify-content: center;
    }

    .contact-socials {
        justify-content: center;
    }

    .projects-grid, .services-grid {
        grid-template-columns: 1fr;
    }

    .project-filter {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        margin-bottom: 10px;
    }

    .footer-newsletter form {
        flex-direction: column;
    }

    .footer-newsletter button {
        width: 100%;
        margin-top: 10px;
        border-radius: 4px;
    }
}
