/* ==========================================================================
   1. ROOT VARIABLES
   ========================================================================== */
:root {
    /* Color Scheme: Complementary (Deep Blue & Golden Yellow) */
    --primary-color: #0d2c4f;      /* Deep Retro Blue */
    --secondary-color: #d4af37;    /* Golden Yellow/Ochre */
    --secondary-color-dark: #b89a2e;
    --accent-color: #4a908a;       /* Muted Teal */
    --background-color: #fdfaf5;   /* Light Cream */
    --dark-background-color: #f0ebe5; /* Slightly darker cream for alternate sections */
    --text-color: #333333;
    --heading-color: #222222;
    --light-text-color: #fdfaf5;
    --border-color: #dddddd;

    /* Typography */
    --font-primary: 'Space Grotesk', sans-serif;
    --font-secondary: 'DM Sans', sans-serif;

    /* Transitions & Animations */
    --transition-speed: 0.3s;
    --transition-bouncy: cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Spacing */
    --header-height: 80px;
    --spacing-unit: 1rem;
}

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

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

body {
    font-family: var(--font-secondary);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    color: var(--heading-color);
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

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

p {
    margin-top: 0;
    margin-bottom: var(--spacing-unit);
}

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

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

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

/* ==========================================================================
   3. LAYOUT & CONTAINER
   ========================================================================== */
.container {
    width: 90%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.section {
    padding: clamp(3rem, 8vw, 6rem) 0;
}

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

.section-title {
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 4rem);
}

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

/* ==========================================================================
   4. GLOBAL COMPONENTS (Buttons, Forms, Cards)
   ========================================================================== */
/* --- Buttons --- */
.btn, button, input[type="submit"] {
    display: inline-block;
    padding: 12px 30px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-speed) var(--transition-bouncy);
    user-select: none;
}

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

.btn-primary:hover {
    background-color: var(--secondary-color-dark);
    border-color: var(--secondary-color-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    color: var(--primary-color);
}

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

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background-color: #fff;
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

/* --- Cards --- */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform var(--transition-speed) var(--transition-bouncy), box-shadow var(--transition-speed) ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

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

.card .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 .card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card h3 {
    margin-bottom: 0.75rem;
}

.read-more {
    margin-top: auto;
    font-family: var(--font-primary);
    font-weight: bold;
    color: var(--accent-color);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: color var(--transition-speed) ease;
}

.read-more:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   5. HEADER & NAVIGATION
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(13, 44, 79, 0.85);
    backdrop-filter: blur(10px);
    padding: 0 20px;
    transition: background-color var(--transition-speed) ease;
}

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

.nav-logo {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--light-text-color);
}

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

.nav-link {
    color: var(--light-text-color);
    font-family: var(--font-primary);
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

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

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

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

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

/* ==========================================================================
   6. PAGE TRANSITIONS (BARBA.JS)
   ========================================================================== */
.barba-leave-active,
.barba-enter-active {
    transition: opacity .5s ease;
}
.barba-leave-to,
.barba-enter-from {
    opacity: 0;
}

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

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

.hero-title {
    color: #FFFFFF;
    margin-bottom: 1rem;
}

.hero-subtitle {
    color: #FFFFFF;
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* --- Features --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.feature-card {
    background-color: #fff;
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.feature-card .card-image {
    margin: 0 auto 1.5rem auto;
    width: 100%;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
}

/* --- Services --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* --- Vision --- */
.vision-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.vision-image img {
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* --- Research/Process --- */
.progress-container {
    display: grid;
    gap: 2.5rem;
}
.progress-step h3 {
    margin-bottom: 0.5rem;
}
.progress-bar-wrapper {
    width: 100%;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 1rem;
}
.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 5px;
    width: 0; /* JS will animate this */
    transition: width 1.5s var(--transition-bouncy);
}

/* --- Pricing --- */
.pricing-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto 2rem auto;
    background-color: #fff;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
.pricing-category h3 {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 1rem;
}
.pricing-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pricing-category li {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
}
.pricing-category li:last-child {
    border-bottom: none;
}
.pricing-category li span:last-child {
    font-family: var(--font-primary);
    font-weight: bold;
    color: var(--primary-color);
}
.pricing-note {
    text-align: center;
    font-style: italic;
    color: #777;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Blog --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* --- Resources --- */
.resources-list {
    display: grid;
    gap: 1.5rem;
}
.resource-item a {
    display: block;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}
.resource-item a:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    transform: translateY(-5px);
}
.resource-title {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
.resource-description {
    color: var(--text-color);
    margin-bottom: 0.75rem;
}
.resource-url {
    font-size: 0.9rem;
    color: var(--accent-color);
}

/* --- Contact --- */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 4rem;
    align-items: center;
}
.contact-info ul {
    list-style: none;
    padding: 0;
}
.contact-info li {
    margin-bottom: 1rem;
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
.footer {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 4rem 0;
}
.footer a {
    color: var(--light-text-color);
    opacity: 0.8;
}
.footer a:hover {
    opacity: 1;
    color: var(--secondary-color);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}
.footer-heading {
    font-family: var(--font-primary);
    color: var(--light-text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   9. SPECIFIC PAGE STYLES
   ========================================================================== */
/* --- success.html --- */
.success-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
}
.success-page h1 {
    color: var(--accent-color);
}
/* --- privacy.html, terms.html --- */
.page-content {
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: 4rem;
    min-height: 100vh;
}
.page-content h1 {
    margin-bottom: 2rem;
}
.page-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   10. ANIMATIONS
   ========================================================================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   11. MEDIA QUERIES
   ========================================================================== */
@media (max-width: 992px) {
    .vision-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .vision-image {
        order: -1;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        flex-direction: column;
        background-color: var(--primary-color);
        width: 100%;
        height: calc(100vh - var(--header-height));
        text-align: center;
        transition: 0.3s;
        gap: 2rem;
        padding-top: 3rem;
    }

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

    .nav-item {
        margin: 1rem 0;
    }

    .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);
    }

    .pricing-table {
        padding: 2rem;
    }

    .contact-container {
        gap: 2rem;
    }
}