/* style.css */

/* --- CSS Variables --- */
:root {
    /* Color Palette - Neutral with a touch of brand identity */
    --color-primary: #007A8D; /* A muted, sophisticated teal */
    --color-primary-dark: #005a69;
    --color-text-dark: #222222;
    --color-text-body: #4a4a4a;
    --color-text-light: #FFFFFF;
    --color-background-main: #f7f7f7;
    --color-background-section: #FFFFFF;
    --color-border: #e0e0e0;
    --color-neutral-dark: #1c1c1c;

    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Merriweather', serif;

    /* Spacing & Layout */
    --header-height: 80px;
    --container-width: 1200px;
    --container-padding: 0 20px;
    --section-padding: 60px 0;

    /* Effects & Transitions */
    --border-radius-soft: 15px;
    --border-radius-biomorphic: 60% 40% 30% 70% / 60% 30% 70% 40%;
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-strong: 0 12px 40px rgba(0, 0, 0, 0.12);
    --transition-speed: 0.4s;
    --easing-nonlinear: cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.7;
    color: var(--color-text-body);
    background-color: var(--color-background-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1.3;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

p {
    margin-bottom: 1rem;
}

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

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* --- Layout --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

.section {
    padding: var(--section-padding);
    background-color: var(--color-background-section);
    overflow: hidden; /* Contains animations and shapes */
}

.section:nth-of-type(odd) {
    background-color: var(--color-background-main);
}

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

.section-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3.5rem auto;
    font-size: 1.1rem;
}

/* --- Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all var(--transition-speed) var(--easing-nonlinear);
    box-shadow: var(--shadow-soft);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-logo {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--color-text-dark);
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text-dark);
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform var(--transition-speed) var(--easing-nonlinear);
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--color-text-dark);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: var(--color-text-light);
    text-align: center;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Simple Parallax */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%);
}

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

.hero-title {
    color: var(--color-text-light);
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-family: var(--font-body);
}

/* --- Global Button Styles --- */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 50px; /* Modern pill shape */
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all var(--transition-speed) var(--easing-nonlinear);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    box-shadow: 0 4px 15px rgba(0, 122, 141, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary-dark);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-speed) var(--easing-nonlinear);
    z-index: -1;
}

.btn:hover {
    color: var(--color-text-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 122, 141, 0.4);
}

.btn:hover::before {
    transform: scaleX(1);
}

.btn:active {
    transform: translateY(-1px);
}

/* --- Card Styles --- */
.card {
    background-color: var(--color-background-section);
    border-radius: var(--border-radius-soft);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: transform var(--transition-speed) var(--easing-nonlinear), box-shadow var(--transition-speed) var(--easing-nonlinear);
    display: flex;
    flex-direction: column;
    height: 100%; /* For equal height cards in a grid */
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-strong);
}

.card-image {
    width: 100%;
    height: 250px; /* Fixed height for image container */
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image covers the area without distortion */
    transition: transform var(--transition-speed) var(--easing-nonlinear);
}

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

.card-content {
    padding: 2rem;
    text-align: left;
    flex-grow: 1;
}

.card-content h3 {
    margin-bottom: 1rem;
}

/* --- Partners Section --- */
.partners-carousel {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.partners-carousel .carousel-track {
    display: flex;
    width: calc(150px * 16); /* 8 original + 8 cloned */
    animation: scroll 30s linear infinite;
}

.partners-carousel .carousel-slide {
    width: 150px;
    height: 75px;
    margin: 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partners-carousel .carousel-slide img {
    max-width: 100%;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all var(--transition-speed) ease;
}

.partners-carousel .carousel-slide:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-150px * 8 - 40px * 8 * 2)); }
}

/* --- Methodology (Timeline) Section --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--color-primary);
    border-radius: var(--border-radius-biomorphic);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 70px;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 70px;
    text-align: left;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--color-background-main);
    border: 4px solid var(--color-primary);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(even)::after {
    left: -10px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: var(--color-background-section);
    position: relative;
    border-radius: var(--border-radius-soft);
    box-shadow: var(--shadow-soft);
}

/* --- Portfolio & News Section --- */
.portfolio-grid, .news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.news-card .card-content {
    display: flex;
    flex-direction: column;
}

.news-date {
    display: block;
    font-family: var(--font-heading);
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.read-more {
    margin-top: auto; /* Pushes the link to the bottom */
    font-family: var(--font-heading);
    font-weight: 700;
}

/* --- Testimonials Section --- */
.testimonials-carousel {
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}
.testimonials-carousel .carousel-track {
    display: flex;
}
.testimonial-card {
    flex: 0 0 100%;
    box-sizing: border-box;
    background-color: transparent;
    box-shadow: none;
    text-align: center;
    padding: 0 2rem;
}
.testimonial-card p {
    font-size: 1.4rem;
    font-style: italic;
    margin-bottom: 1.5rem;
}
.testimonial-card h4 {
    color: var(--color-primary);
}


/* --- Resources Section --- */
.section-resources {
    background-color: var(--color-neutral-dark);
}

#recursos .section-title, #recursos .section-intro {
    color: var(--color-text-light);
}

.resources-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.resource-link {
    display: block;
    padding: 1rem 2rem;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    transition: all var(--transition-speed) var(--easing-nonlinear);
}

.resource-link:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-5px);
}

/* --- Contact Section --- */
.section-contact .container {
    max-width: none;
    padding: 0;
}

.contact-wrapper {
    max-width: var(--container-width);
    margin: auto;
    padding: var(--section-padding);
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: center;
}

.contact-info {
    color: var(--color-text-dark);
}
.contact-info h3 {
    margin-bottom: 1.5rem;
}

.contact-form-container {
    background: rgba(255, 255, 255, 0.7);
    padding: 3rem;
    border-radius: var(--border-radius-soft);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-strong);
}

.contact-form .form-group {
    position: relative;
    margin-bottom: 2rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text-dark);
    transition: border-color var(--transition-speed) var(--easing-nonlinear);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.contact-form label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--color-text-body);
    pointer-events: none;
    transition: all var(--transition-speed) var(--easing-nonlinear);
}

.contact-form input:focus + label,
.contact-form input:not(:placeholder-shown) + label,
.contact-form textarea:focus + label,
.contact-form textarea:not(:placeholder-shown) + label {
    top: -0.75rem;
    left: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-primary);
    background-color: #fff;
    padding: 0 5px;
}

/* --- Footer --- */
.footer {
    background-color: var(--color-neutral-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 4rem 0 2rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

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

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-col ul li a:hover {
    color: var(--color-text-light);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    font-size: 0.9rem;
}

/* --- Scroll Animations --- */
[data-scroll-animation] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--easing-nonlinear), transform 0.8s var(--easing-nonlinear);
}

[data-scroll-animation].is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Other Pages (Success, Legal) --- */
.success-page, .legal-page-body, .contacts-page-body, .about-page-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.success-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.legal-content, .contacts-content, .about-content {
    padding-top: calc(var(--header-height) + 40px);
    flex-grow: 1;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        flex-direction: column;
        background-color: var(--color-background-section);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-soft);
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        padding: 1.5rem 0;
        border-bottom: 1px solid var(--color-border);
    }
    
    .nav-link::after {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item:nth-child(odd), .timeline-item:nth-child(even) {
        left: 0;
        text-align: left;
    }

    .timeline-item::after {
        left: 21px;
    }
}