/*
================================================
TABLE OF CONTENTS
================================================
1.  :root Variables & General Styles
2.  Header & Navigation
3.  Hero Section
4.  General Section Styling
5.  Expertise & Process Sections
6.  Work & Principles (FAQ) Sections
7.  Final CTA Section
8.  Footer
9.  Sub-Page Styles (Contact, Legal)
10. Animations & Keyframes
11. Responsive Media Queries
================================================
*/

/* 1. :root Variables & General Styles */
:root {
    --color-primary: #E63946;
    /* Red */
    --color-dark: #111111;
    --color-light: #FFFFFF;
    --color-background: #F4F4F4;
    --color-text: #333;
    --color-border: #DDDDDD;

    --font-main: 'Work Sans', sans-serif;

    --header-height: 90px;
    --transition-speed: 0.3s;
    --section-padding: 120px 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-main);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.nav-open {
    overflow: hidden;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

a:hover {
    opacity: 0.7;
}

ul {
    list-style: none;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-main);
    color: var(--color-dark);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(3rem, 6vw, 5rem);
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.5rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: var(--section-padding);
}

.cta-button {
    display: inline-block;
    padding: 14px 32px;
    background-color: var(--color-primary);
    color: #fff;
    border: 2px solid var(--color-primary);
    transition: all var(--transition-speed) ease;
}

.cta-button:hover {
    background-color: transparent;
    color: var(--color-primary);
}

.text-center {
    text-align: center;
}

/* 2. Header & Navigation */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: all var(--transition-speed) ease;
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
}

#main-header.scrolled {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link img {
    max-height: 80px;
    filter: invert(1);
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-link {
    color: var(--color-dark);
    font-weight: 700;
}

#hamburger-btn {
    display: none;
    background: none;
    border: none;
    z-index: 1001;
    cursor: pointer;
}

#hamburger-btn .bar {
    display: block;
    width: 25px;
    height: 2px;
    margin: 6px auto;
    background-color: var(--color-dark);
    transition: all 0.3s ease-in-out;
}

/* 3. Hero Section */
#hero {
    padding: calc(var(--header-height) + 80px) 0 100px;
    background-color: #fff;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
}

.hero-content {
    max-width: 800px;
}

#hero h1 {
    margin-bottom: 1.5rem;
}

#hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2.5rem;
}

/* 4. General Section Styling */
.section-title {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: var(--color-primary);
    margin: 1rem auto 0;
}

/* 5. Expertise & Process Sections */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1px;
    background-color: var(--color-border);
    border: 1px solid var(--color-border);
}

.expertise-item {
    background-color: #fff;
    padding: 2rem;
}

.expertise-item span {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

#process {
    background-color: #fff;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 4rem auto 0;
    padding-left: 30px;
    border-left: 1px solid var(--color-border);
}

.timeline-item {
    position: relative;
    padding-bottom: 3rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 5px;
    left: -36px;
    width: 11px;
    height: 11px;
    background-color: var(--color-background);
    border: 2px solid var(--color-primary);
    border-radius: 50%;
}

.timeline-content h3 {
    font-size: 1.8rem;
}

/* 6. Work & Principles (FAQ) Sections */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.work-item {
    background-color: #fff;
    border: 1px solid var(--color-border);
    padding: 2rem;
    transition: border-color var(--transition-speed) ease;
}

.work-item:hover {
    border-color: var(--color-primary);
}

#principles {
    background-color: #fff;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1.5rem 0;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--color-primary);
    transition: transform 0.2s ease;
}

.faq-item.active .faq-question::after {
    content: '–';
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease-in-out;
}

.faq-answer p {
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
}

/* THIS IS THE FIX */
.faq-item.active .faq-answer {
    max-height: 200px;
    /* Adjust as needed for content length */
}

/* 7. Final CTA Section */
#final-cta h2 {
    font-size: 3rem;
}

#final-cta p {
    max-width: 600px;
    margin: 1rem auto 2.5rem;
}

/* 8. Footer */
#main-footer {
    background-color: var(--color-light);
    padding: 80px 0 0;
    border-top: 1px solid var(--color-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 2rem;
    padding-bottom: 40px;
}

.footer-col h4 {
    color: var(--color-dark);
    margin-bottom: 1.5rem;
}

.footer-bottom {
    padding: 25px 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

/* 9. Sub-Page Styles */
.page-header {
    padding: 150px 0 80px;
    text-align: center;
    background-color: #fff;
    border-bottom: 1px solid var(--color-border);
}

#contact-page .contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--color-border);
}

.contact-info-wrapper {
    background-color: #fff;
    border: 1px solid var(--color-border);
    padding: 2rem;
}

.legal-content .container {
    max-width: 800px;
    background-color: #fff;
    padding: 4rem;
}

.legal-content h2 {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* 10. Animations & Keyframes */
.animate-on-load {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s, transform 0.8s;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 11. Responsive Media Queries */
@media (max-width: 992px) {
    #main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 350px;
        height: 100vh;
        background-color: #fff;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease-in-out;
    }

    #main-nav.is-active {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        gap: 30px;
    }

    .header-cta {
        display: none;
    }

    #hamburger-btn {
        display: block;
        z-index: 1001;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    #contact-page .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}