/* ============================================= */
/* CSS VARIABLES & ROOT STYLES                   */
/* ============================================= */
:root {
    /* Analogous Color Scheme (Warm, Vibrant, Retro Feel) */
    --primary-color: #E63946;   /* Vibrant Red-Orange */
    --secondary-color: #F4A261; /* Warm Sandy Orange */
    --accent-color: #457B9D;    /* Cool Calming Blue */
    --background-color: #F1FAEE;/* Off-White/Light Mint */
    --alt-background-color: #A8DADC; /* Light Aqua Blue */
    --text-color: #1D3557;      /* Dark Blue */
    --light-text-color: #FFFFFF;
    --border-color: #ddd;
    
    /* Typography */
    --font-heading: 'Roboto', sans-serif;
    --font-body: 'Lato', sans-serif;
    
    /* Spacing & Sizing */
    --header-height: 80px;
    --border-radius: 8px;
    --container-padding: 1rem;
    --section-padding: 5rem 0;
}

/* ============================================= */
/* BASE & GLOBAL STYLES                          */
/* ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

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

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

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

.site-section.alt-bg {
    background-color: var(--alt-background-color);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 1rem auto 0;
    border-radius: 2px;
    transform: skewX(-20deg);
}

.section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: -2rem auto 3rem;
    font-size: 1.1rem;
    color: #555;
}

/* ============================================= */
/* GLOBAL UI COMPONENTS (Buttons, Forms, Cards)  */
/* ============================================= */

/* Buttons */
.btn, button, input[type="submit"] {
    display: inline-block;
    padding: 12px 30px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--light-text-color);
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn:hover, button:hover, input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    background-color: #c42d38;
    border-color: #c42d38;
    text-decoration: none;
    color: var(--light-text-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.3);
}

/* Cards */
.card {
    background: var(--light-text-color);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-align: center;
}

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

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

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

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-content h4 {
    margin-bottom: 0.5rem;
}

/* ============================================= */
/* HEADER & NAVIGATION                           */
/* ============================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(29, 53, 87, 0.8);
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--light-text-color);
    text-decoration: none;
}
.logo:hover {
    text-decoration: none;
    color: var(--secondary-color);
}

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

.main-nav a {
    color: var(--light-text-color);
    font-weight: 700;
    position: relative;
    padding: 5px 0;
    text-transform: uppercase;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--secondary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease-in-out;
}

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

/* Mobile Navigation */
.burger-menu {
    display: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 1001;
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--light-text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(29, 53, 87, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    text-align: center;
}

.mobile-nav li {
    margin: 2rem 0;
}

.mobile-nav a {
    color: var(--light-text-color);
    font-size: 2rem;
    font-weight: 700;
}

/* Mobile Nav Active State */
body.nav-open .mobile-nav {
    transform: translateX(0);
}

body.nav-open .burger-menu span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
body.nav-open .burger-menu span:nth-child(2) {
    opacity: 0;
}
body.nav-open .burger-menu span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ============================================= */
/* HERO SECTION                                  */
/* ============================================= */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light-text-color);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    color: var(--light-text-color);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* ============================================= */
/* ABOUT US SECTION                              */
/* ============================================= */
.warped-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

.warped-grid .image-block {
    position: relative;
    transform: rotate(2deg);
    transition: transform 0.4s ease;
}
.warped-grid .image-block:hover {
    transform: rotate(0deg);
}
.warped-grid .image-block img {
    border-radius: var(--border-radius);
    box-shadow: 10px 10px 30px rgba(0,0,0,0.2);
}

.warped-grid .text-block {
    background: var(--light-text-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: -5px 5px 20px rgba(0,0,0,0.08);
    transform: rotate(-1deg);
    transition: transform 0.4s ease;
}
.warped-grid .text-block:hover {
    transform: rotate(0);
}

/* ============================================= */
/* PROJECTS & TEAM SECTION (CAROUSEL)            */
/* ============================================= */
.content-carousel {
    position: relative;
}

.carousel-wrapper {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1.5rem; /* For scrollbar */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.carousel-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.carousel-wrapper .card {
    flex: 0 0 90%;
    max-width: 90%;
    scroll-snap-align: center;
}

.team-card .card-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 1.5rem auto 0;
    border: 5px solid var(--alt-background-color);
}
.team-card span {
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 1rem;
    display: block;
}

.carousel-controls {
    display: none; /* JS will handle this, but hidden by default */
    justify-content: center;
    margin-top: 2rem;
    gap: 1rem;
}

.carousel-controls button {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    font-size: 1.5rem;
}

/* ============================================= */
/* INSIGHTS SECTION (TOGGLE)                     */
/* ============================================= */
.toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.toggle-label {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--alt-background-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.insights-content {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.insights-content.active {
    display: block;
}

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

/* ============================================= */
/* METHODOLOGY SECTION (TIMELINE)                */
/* ============================================= */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

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

.timeline-item {
    padding: 1rem 3rem;
    position: relative;
    width: 50%;
}

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

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

.timeline-item:nth-child(even) {
    left: 50%;
}

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

.timeline-content {
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* ============================================= */
/* RESEARCH & NEWS SECTION                       */
/* ============================================= */
.research-grid, .news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.research-item, .news-item {
    text-align: center;
}
.research-item img {
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}
.news-item {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}
.news-content {
    padding: 1.5rem;
    text-align: left;
}
.news-date {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 0.5rem;
    display: block;
}
.read-more {
    font-weight: 700;
    display: inline-block;
    margin-top: 1rem;
}
.read-more::after {
    content: ' →';
}

/* ============================================= */
/* SUSTAINABILITY SECTION                        */
/* ============================================= */
.sustainability-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}
.sustainability-content img {
    border-radius: var(--border-radius);
}

/* ============================================= */
/* EXTERNAL RESOURCES SECTION                    */
/* ============================================= */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.resource-card {
    background: var(--light-text-color);
    border: 2px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    color: var(--text-color);
}
.resource-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-decoration: none;
}
.resource-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.resource-card p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.resource-url {
    font-size: 0.8rem;
    color: #777;
    font-weight: 700;
}

/* ============================================= */
/* FAQ SECTION (ACCORDION)                       */
/* ============================================= */
.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.accordion-item {
    background-color: var(--background-color);
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.accordion-header {
    width: 100%;
    background-color: transparent;
    border: none;
    padding: 1.5rem;
    text-align: left;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    color: var(--text-color);
}

.accordion-header::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.accordion-header.active::after {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content p {
    padding: 0 1.5rem 1.5rem;
    margin: 0;
}

/* ============================================= */
/* CONTACT SECTION                               */
/* ============================================= */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius);
}

.contact-info a {
    word-break: break-all;
}

/* ============================================= */
/* FOOTER                                        */
/* ============================================= */
.site-footer {
    background-color: var(--text-color);
    color: #ccc;
    padding: 4rem 0 2rem;
}

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

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

.footer-col p, .footer-col ul {
    font-size: 0.95rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

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

.footer-col a {
    color: #ccc;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 2rem;
    font-size: 0.9rem;
}

/* ============================================= */
/* PAGE-SPECIFIC STYLES                          */
/* ============================================= */

/* Success Page */
.success-page main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

/* Legal Pages (Privacy, Terms) */
.legal-page-content {
    padding-top: calc(var(--header-height) + 3rem);
    padding-bottom: 3rem;
}
.legal-page-content .container {
    max-width: 800px;
}
.legal-page-content h1 {
    margin-bottom: 2rem;
}
.legal-page-content h2 {
    margin-top: 2.5rem;
}

/* ============================================= */
/* RESPONSIVE MEDIA QUERIES                      */
/* ============================================= */

/* Tablet */
@media (min-width: 768px) {
    .burger-menu, .mobile-nav {
        display: none;
    }
    .main-nav {
        display: block;
    }
    .warped-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .research-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sustainability-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
    .contact-wrapper {
        grid-template-columns: 1fr 1.5fr;
    }
    .carousel-wrapper .card {
        flex-basis: 45%;
        max-width: 45%;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .timeline::after {
        left: 50%;
    }
    .timeline-item {
        width: 50%;
    }
    .timeline-item:nth-child(even) {
        left: 50%;
    }
    .timeline-item:nth-child(odd) {
        left: 0;
        text-align: right;
        padding: 1rem 3rem 1rem 0;
    }
    .timeline-item:nth-child(even) {
        text-align: left;
        padding: 1rem 0 1rem 3rem;
    }
    .timeline-item:nth-child(odd)::after {
        right: -10px;
    }
    .timeline-item:nth-child(even)::after {
        left: -10px;
    }
    .carousel-wrapper .card {
        flex-basis: 31%;
        max-width: 31%;
    }
}