/* ==========================================================================
   1. CSS Variables & Global Settings
   ========================================================================== */

:root {
    /* Analogous Color Scheme */
    --color-primary: #0D9488; /* Teal */
    --color-primary-dark: #047857;
    --color-secondary: #059669; /* Greenish Teal */
    --color-accent: #0891B2; /* Bluish Teal */

    /* Neutral Palette */
    --color-text: #374151;
    --color-text-headings: #111827;
    --color-text-light: #F9FAFB;
    --color-background-light: #F9FAFB;
    --color-background-section: #FFFFFF;
    --color-border: #D1D5DB;
    --color-white: #FFFFFF;
    --color-black: #000000;

    /* Fonts */
    --font-family-headings: 'Space Grotesk', sans-serif;
    --font-family-body: 'DM Sans', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;
    --container-width: 1140px;
    --container-padding: 1.5rem;

    /* Transitions & Animations */
    --transition-fast: all 0.2s ease-in-out;
    --transition-bouncy: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Borders & Shadows */
    --border-radius: 8px;
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

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

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

/* ==========================================================================
   2. Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    color: var(--color-text-headings);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

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

p {
    margin-bottom: var(--spacing-md);
    font-size: clamp(1rem, 1vw + 0.5rem, 1.125rem);
}

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

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

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

/* ==========================================================================
   3. Layout & Helpers
   ========================================================================== */

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

.section {
    padding: var(--spacing-lg) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-headings);
}

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

.has-text-centered {
    text-align: center;
}

/* Bulma-like Columns */
.columns {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}
.column {
    display: block;
    flex-basis: 0;
    flex-grow: 1;
    flex-shrink: 1;
    padding: 0.75rem;
}
.is-vcentered { align-items: center; }
.is-centered { justify-content: center; }
.is-multiline { flex-wrap: wrap; }
.is-one-quarter { flex: none; width: 25%; }
.is-one-third { flex: none; width: 33.3333%; }
.is-two-thirds { flex: none; width: 66.6667%; }

/* ==========================================================================
   4. Header & Navigation
   ========================================================================== */

.site-header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: var(--spacing-sm) 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
}

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

.navbar-brand .logo {
    font-family: var(--font-family-headings);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}
.site-header.scrolled .navbar-brand .logo {
    color: var(--color-text-headings);
}
.logo:hover {
    color: var(--color-primary-dark);
}

.navbar-menu {
    display: flex;
    align-items: center;
}

.navbar-end {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.navbar-item {
    color: var(--color-white);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    transition: var(--transition-fast);
    text-decoration: none;
}
.site-header.scrolled .navbar-item {
    color: var(--color-text);
}
.navbar-item:hover, .navbar-item.is-active {
    color: var(--color-primary);
    text-decoration: none;
}

.navbar-burger { display: none; }

/* ==========================================================================
   5. General Components
   ========================================================================== */

/* Global Button Styles */
.button {
    display: inline-block;
    font-family: var(--font-family-body);
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition-bouncy);
    text-decoration: none;
    transform: scale(1);
}

.button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    text-decoration: none;
}

.button.is-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}
.button.is-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-white);
}

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

.button.is-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.button.is-small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

/* Card Styles */
.card {
    background-color: var(--color-background-section);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.card-image, .image-container {
    width: 100%;
    overflow: hidden;
}

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

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

.card-content {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Form Styles */
.contact-form .field {
    margin-bottom: var(--spacing-md);
}
.contact-form .label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-headings);
    margin-bottom: var(--spacing-xs);
    display: block;
}
.contact-form .input,
.contact-form .textarea {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-family: var(--font-family-body);
    color: var(--color-text);
    background-color: var(--color-background-light);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.contact-form .input:focus,
.contact-form .textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}
.contact-form .textarea {
    min-height: 150px;
    resize: vertical;
}

/* ==========================================================================
   6. Section-Specific Styles
   ========================================================================== */

/* Hero Section */
.hero {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    color: var(--color-white);
}
.hero.is-fullheight {
    min-height: 100vh;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}
.hero-body {
    position: relative;
    z-index: 2;
    width: 100%;
}
.hero-title {
    color: var(--color-white);
    margin-bottom: var(--spacing-md);
}
.hero-subtitle {
    font-size: clamp(1.1rem, 2vw + 0.5rem, 1.5rem);
    max-width: 800px;
    margin: 0 auto var(--spacing-lg) auto;
    font-weight: 400;
}

/* About Section */
#about .content p {
    max-width: 90%;
}
.image-gallery {
    display: grid;
    gap: var(--spacing-sm);
}
.image-gallery .image-container img {
    border-radius: var(--border-radius);
}

/* Stats Section */
.stat-widget {
    padding: var(--spacing-md);
}
.stat-number {
    font-family: var(--font-family-headings);
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
}
.stat-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}
.stat-description {
    font-size: 0.9rem;
    color: #6B7280;
}

/* Events Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--color-border);
    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; }
.timeline-item:nth-child(even) { left: 50%; }
.timeline-marker {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--color-white);
    border: 4px solid var(--color-primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-item:nth-child(even) .timeline-marker {
    left: -10px;
}
.timeline-content {
    padding: var(--spacing-md);
    background-color: var(--color-background-section);
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.timeline-date {
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

/* Team Slider */
.slider-container {
    position: relative;
}
.custom-slider {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}
.custom-slider::-webkit-scrollbar { display: none; }
.team-card {
    flex: 0 0 calc(33.333% - var(--spacing-md));
    scroll-snap-align: start;
    text-align: center;
    align-items: center;
}
.team-card .card-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-top: var(--spacing-md);
    border: 4px solid var(--color-primary);
}
.team-card .card-image img {
    border-radius: 50%;
}
.member-name { margin-top: var(--spacing-md); }
.member-title {
    font-style: italic;
    color: var(--color-accent);
    margin-bottom: var(--spacing-sm);
}
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    color: var(--color-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.slider-nav.prev { left: -20px; }
.slider-nav.next { right: -20px; }

/* Resources */
.resource-list {
    max-width: 800px;
    margin: var(--spacing-md) auto 0;
    background: var(--color-background-section);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.resource-list ul { list-style: none; }
.resource-list li {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
}
.resource-list li:last-child { border-bottom: none; }
.resource-list a { font-weight: 500; }
.resource-list a::after { content: ' →'; }

/* Careers Section */
.job-listing {
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    background: var(--color-background-section);
}
.job-listing h3 { margin-bottom: var(--spacing-xs); }
.job-listing p { margin-bottom: var(--spacing-sm); }
.job-listing strong { color: var(--color-text-headings); }

/* ==========================================================================
   7. Footer
   ========================================================================== */

.site-footer {
    background-color: var(--color-text-headings);
    color: #A0AEC0;
    padding: var(--spacing-lg) 0;
}
.footer-title {
    font-family: var(--font-family-headings);
    color: var(--color-white);
    margin-bottom: var(--spacing-md);
}
.site-footer ul {
    list-style: none;
    padding: 0;
}
.site-footer li {
    margin-bottom: var(--spacing-xs);
}
.site-footer a {
    color: #A0AEC0;
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}
.site-footer hr {
    border: none;
    height: 1px;
    background-color: #4A5568;
    margin: var(--spacing-md) 0;
}
.copyright {
    font-size: 0.9rem;
}

/* ==========================================================================
   8. Specific Page Styles
   ========================================================================== */

.page-content {
    padding-top: 100px;
    padding-bottom: var(--spacing-xl);
}

.success-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    padding: var(--container-padding);
}
.success-page .icon {
    font-size: 5rem;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

/* ==========================================================================
   9. Animations
   ========================================================================== */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: none !important;
}
[data-animation="fadeInUp"] { transform: translateY(30px); }
[data-animation="fadeInDown"] { transform: translateY(-30px); }
[data-animation="fadeInLeft"] { transform: translateX(-30px); }
[data-animation="fadeInRight"] { transform: translateX(30px); }
[data-animation="zoomIn"] { transform: scale(0.9); }

/* ==========================================================================
   10. Media Queries (Responsive)
   ========================================================================== */

@media (max-width: 1024px) {
    .team-card { flex: 0 0 calc(50% - var(--spacing-md)); }
    .timeline::after { left: 30px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item:nth-child(odd), .timeline-item:nth-child(even) { left: 0; }
    .timeline-marker { left: 15px; }
    .timeline-item:nth-child(even) .timeline-marker { left: 15px; }
}

@media (max-width: 768px) {
    .columns { margin-left: 0; margin-right: 0; }
    .column { width: 100% !important; flex: none; padding-left: 0; padding-right: 0; }

    /* Mobile Navigation */
    .navbar-menu {
        display: none;
        position: absolute;
        left: 0;
        top: 100%;
        width: 100%;
        background-color: var(--color-white);
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    }
    .navbar-menu.is-active { display: block; }
    .navbar-end {
        flex-direction: column;
        align-items: stretch;
        padding: var(--spacing-sm);
    }
    .navbar-item { color: var(--color-text-headings); }

    .navbar-burger {
        display: block;
        cursor: pointer;
        border: none;
        background: transparent;
        position: relative;
        width: 3rem;
        height: 3rem;
    }
    .navbar-burger span {
        display: block;
        position: absolute;
        height: 3px;
        width: 25px;
        background: var(--color-white);
        border-radius: 9999px;
        transition: transform 0.3s, opacity 0.3s;
        left: calc(50% - 12.5px);
    }
    .site-header.scrolled .navbar-burger span { background: var(--color-text); }
    .navbar-burger span:nth-child(1) { top: 12px; }
    .navbar-burger span:nth-child(2) { top: 20px; }
    .navbar-burger span:nth-child(3) { top: 28px; }

    .navbar-burger.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .navbar-burger.is-active span:nth-child(2) { opacity: 0; }
    .navbar-burger.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .team-card { flex: 0 0 90%; }
    .slider-nav { display: none; }
}