@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Open+Sans:wght@300;400;600;700&display=swap');

:root {
    /* Colours */
    --color-primary: #5F9EA0; /* CadetBlue - professional, calming */
    --color-accent: #E6B05C; /* Warm gold/orange - inviting */
    --color-text: #333333;
    --color-text-light: #666666;
    --color-bg: #FFFFFF;
    --color-light-bg: #F8FBFB; /* Very light grey/blue for contrast sections */
    --color-dark-bg: #2C3E50; /* Dark blue-grey for footer/contrast */
    --color-white: #FFFFFF;

    /* Fonts */
    --font-heading: 'Merriweather', serif;
    --font-body: 'Open Sans', sans-serif;

    /* Spacing */
    --padding-section: 4rem 0;
    --gap-cards: 2rem;

    /* Transitions */
    --transition-speed: 0.2s ease-in-out;
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--color-accent);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; margin-bottom: 1.5rem;}
h3 { font-size: 1.75rem; margin-bottom: 0.75rem;}
p { margin-bottom: 1rem; }

.section-padding {
    padding: var(--padding-section);
}

.section-title {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.section-subtitle {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.15rem;
    color: var(--color-text-light);
}

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

/* Buttons */
.button-primary, .button-secondary {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed);
    border: 2px solid transparent;
    font-size: 1rem;
}

.button-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.button-primary:hover {
    background-color: darken(var(--color-primary), 10%); /* Placeholder for CSS preprocessor or manual adjustment */
    background-color: #518b8f; /* Slightly darker primary */
}

.button-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.button-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Card Styles */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap-cards);
}

.card {
    background-color: var(--color-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Scroll Reveal */
.reveal-item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    transition-delay: 0.1s; /* Subtle delay for staggered effect */
}

.reveal-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* CRITICAL scroll-reveal exclusion */
#portal-modal, #portal-modal * { 
    opacity: 1 !important; 
    transform: none !important; 
    transition: none !important;
}

/* Navigation */
nav {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: var(--color-bg);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed), padding var(--transition-speed);
}

nav.scrolled {
    background-color: var(--color-white); /* Keep white or slightly off-white */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
}

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

nav .logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-primary);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--color-text);
    font-weight: 600;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--color-accent);
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
    border-radius: 10px;
    transition: all 0.3s ease-in-out;
}

/* Hero Section */
#hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh; /* Full viewport height */
    text-align: center;
    color: var(--color-white);
    background: url('https://images.unsplash.com/photo-1576099304386-8a5f08b3a241?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') no-repeat center center/cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55); /* Dark overlay */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-white);
}

.hero-subtitle {
    font-size: 1.35rem;
    margin-bottom: 2.5rem;
    color: var(--color-white);
    font-weight: 300;
}

.hero-ctas {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hero-ctas .button-secondary {
    color: var(--color-white);
    border-color: var(--color-white);
}

.hero-ctas .button-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
}

/* Stats Strip */
#stats {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 2rem 0;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: center;
}

.stat-item {
    padding: 1rem;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    line-height: 1.3;
}

/* Services Section */
.service-card h3 {
    color: var(--color-primary);
    text-align: center;
}
.service-card p {
    color: var(--color-text-light);
    text-align: center;
}

/* About Section */
#about {
    padding: var(--padding-section);
    text-align: center;
}
.about-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--color-text-light);
}
.about-content p {
    margin-bottom: 1.2rem;
}


/* Trusted By Section */
.trusted-by {
    background-color: var(--color-light-bg);
    padding: 2.5rem 0;
}

.trusted-by .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

.trusted-by-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.client-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

.client-logos span {
    font-size: 1.1rem;
    font-weight: 600;
    color: #999; /* Muted grey */
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

/* Work/Case Study Section */
.case-study-card {
    display: flex;
    flex-direction: column;
}

.case-study-card .tag {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3em 0.7em;
    border-radius: 4px;
    margin-bottom: 1rem;
    align-self: flex-start;
}

.case-study-card h3 {
    font-weight: 700;
    color: var(--color-primary);
}

.case-study-card p {
    color: var(--color-text-light);
    font-size: 1rem;
    flex-grow: 1; /* Pushes content down */
}

/* Testimonials */
.testimonial-card {
    border-left: 4px solid var(--color-accent);
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.testimonial-card .quote {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.testimonial-card .author {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
    text-align: right;
    margin-top: auto; /* Push to bottom */
}

/* Team Section */
.team-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    text-align: center;
}

.team-card .avatar {
    width: 96px; /* Increased size */
    height: 96px;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: var(--color-white);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem; /* Adjusted for larger size */
    font-weight: 700;
    margin: 0 auto 1.2rem;
    text-transform: uppercase;
}

.team-card h3 {
    margin-bottom: 0.25rem;
    color: var(--color-primary);
}

.team-card .title {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.team-card .bio {
    font-size: 0.95rem;
    color: var(--color-text-light);
}

/* Insights Section */
.insight-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes read more to bottom */
}

.insight-card .date {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.insight-card h3 {
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.insight-card p {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    flex-grow: 1; /* Pushes read more to bottom */
}

.insight-card .read-more {
    color: var(--color-accent);
    font-weight: 600;
    transition: color var(--transition-speed);
    display: inline-block;
    margin-top: 1rem; /* Ensure spacing if p is too short */
}

.insight-card .read-more:hover {
    color: darken(var(--color-accent), 10%); /* Placeholder */
    color: #c08c48; /* Slightly darker accent */
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-cards);
    align-items: start;
}

.contact-info {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-light);
}
.contact-info p a {
    font-weight: 600;
}

.contact-form-container {
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.contact-form-container h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.2); /* Use rgba for focus ring */
    --color-accent-rgb: 230, 176, 92; /* Define RGB for accent color for box-shadow */
}

textarea {
    resize: vertical;
}

.contact-form-container .button-primary {
    width: auto;
    margin-top: 0.5rem;
}

.form-success {
    text-align: center;
    font-size: 1.2rem;
    color: green;
    padding: 2rem;
    border: 1px solid lightgreen;
    border-radius: 5px;
    background-color: #e6ffe6;
}

/* Footer */
footer {
    background-color: var(--color-dark-bg);
    color: var(--color-white);
    padding: 3rem 0;
    font-size: 0.95rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-brand, .footer-links, .footer-contact {
    flex: 1;
    min-width: 250px;
}

footer .logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--color-white);
    margin-bottom: 1rem;
    display: block;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

footer h4 {
    color: var(--color-white);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

footer ul {
    list-style: none;
}

footer ul li {
    margin-bottom: 0.75rem;
}

footer ul li a, footer p a {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

footer ul li a:hover, footer p a:hover {
    color: var(--color-accent);
}

/* Modal */
#portal-modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

#portal-modal.open {
    display: flex;
}

.modal-box {
    background-color: var(--color-white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 450px;
    position: relative;
    animation: fadeInScale 0.3s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-box h2 {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 2rem;
    font-size: 2rem;
}

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

.modal-box .button-primary {
    width: 100%;
    margin-top: 1rem;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-text-light);
    line-height: 1;
    padding: 0;
    transition: color var(--transition-speed);
}

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

.login-error {
    color: red;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
    min-height: 1.5rem; /* Reserve space */
}


/* --- Responsive Design --- */

/* Mobile First - styles for 320px to 599px */
.hero-title {
    font-size: 2.5rem;
}
.hero-subtitle {
    font-size: 1.1rem;
}
.hero-ctas {
    flex-direction: column;
    gap: 1rem;
}
.button-primary, .button-secondary {
    width: 100%;
    padding: 1rem 1.5rem;
}
.nav-links {
    display: none; /* Hide nav links on mobile by default */
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-bg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 1.5rem 0;
    text-align: center;
    height: auto;
    overflow-y: auto;
    transition: transform 0.3s ease-out;
    transform: translateY(-100%);
}
.nav.nav-open .nav-links {
    display: flex;
    transform: translateY(0);
}
.nav-links a, .nav-links button {
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
}
.nav-links button {
    border: none;
    margin-top: 1rem;
    width: 80%; /* Adjust button width for visual appeal */
    margin-left: 10%;
    margin-right: 10%;
}
.nav-links a:last-of-type {
    border-bottom: none;
}
.hamburger {
    display: flex; /* Show hamburger on mobile */
}
.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}
.stats-grid {
    grid-template-columns: 1fr;
}
.trusted-by .container {
    flex-direction: column;
    gap: 1.5rem;
}
.client-logos {
    flex-direction: column;
    gap: 1.5rem;
}
.contact-grid {
    grid-template-columns: 1fr;
}
.footer-content {
    flex-direction: column;
    text-align: center;
}
.footer-links ul {
    padding: 0;
}
.footer-links li {
    margin-bottom: 0.5rem;
}


/* Medium screens (e.g., tablets, 600px and up) */
@media (min-width: 600px) {
    .hero-title {
        font-size: 3rem;
    }
    .hero-subtitle {
        font-size: 1.25rem;
    }
    .hero-ctas {
        flex-direction: row;
        gap: 1.5rem;
    }
    .button-primary, .button-secondary {
        width: auto;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .trusted-by .container {
        flex-direction: row;
        gap: 2rem;
    }
    .client-logos {
        flex-direction: row;
        gap: 2.5rem;
    }
    .contact-grid {
        grid-template-columns: 1fr; /* Stack on smaller tablets if necessary */
    }
}

/* Large screens (e.g., desktops, 960px and up) */
@media (min-width: 960px) {
    .hero-title {
        font-size: 3.8rem;
    }
    .hero-subtitle {
        font-size: 1.35rem;
    }
    .hamburger {
        display: none; /* Hide hamburger on desktop */
    }
    .nav-links {
        display: flex; /* Show nav links on desktop */
        position: static;
        flex-direction: row;
        box-shadow: none;
        padding: 0;
        transform: translateY(0);
        height: auto;
        overflow-y: visible;
    }
    .nav-links a {
        border-bottom: none;
        padding: 0.5rem 0;
    }
    .nav-links button {
        width: auto;
        margin: 0;
    }
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .testimonial-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    .team-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .insights-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
    .client-logos {
        gap: 3rem;
    }
}