/* ==========================================================================
   1. CSS Variables & Global Settings
   ========================================================================== */
:root {
    /* Analogous Color Scheme */
    --bg-color: #e4e9f0; /* Soft, light blue-gray for the main background */
    --light-bg-color: #f0f3f8; /* Slightly lighter for alternate sections */
    --primary-color: #5d87b3; /* Muted, professional blue */
    --secondary-color: #72a4c2; /* Lighter, complementary blue */
    --accent-color: #e8a87c; /* Warm, soft orange accent */

    /* Text Colors */
    --heading-color: #2c3e50; /* Dark slate blue for headings */
    --text-color: #485b6e; /* Softer gray-blue for body text */
    --white-color: #FFFFFF;
    --link-color: var(--primary-color);
    --link-hover-color: var(--accent-color);

    /* Fonts */
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Nunito', sans-serif;

    /* Neumorphism Shadows */
    --shadow-light: rgba(255, 255, 255, 0.7);
    --shadow-dark: rgba(163, 177, 198, 0.6);
    --neumorphic-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    --neumorphic-inset-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);

    /* Sizing & Spacing */
    --header-height: 80px;
    --border-radius: 15px;
    --transition-speed: 0.3s;
}

/* ==========================================================================
   2. Base & Typography
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

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

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    max-width: 75ch;
}

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

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

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

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

.section {
    padding: 6rem 0;
}

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

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.section-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

/* ==========================================================================
   4. Header & Navigation
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: var(--header-height);
    transition: background-color var(--transition-speed) ease;
}

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

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-list a {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--heading-color);
    position: relative;
    padding: 5px 0;
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-speed) ease-in-out;
}

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

.burger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--heading-color);
    margin: 5px 0;
    transition: all var(--transition-speed) ease-in-out;
}

/* ==========================================================================
   5. Global Components (Buttons & Cards)
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--neumorphic-shadow);
    background: var(--bg-color);
    color: var(--text-color);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: var(--neumorphic-inset-shadow);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white-color);
    box-shadow: 6px 6px 12px rgba(0,0,0,0.2), -6px -6px 12px rgba(255,255,255,0.1);
}
.btn-primary:hover {
    background: #4a759d;
}

.btn-secondary {
    background: var(--accent-color);
    color: var(--white-color);
    box-shadow: 6px 6px 12px rgba(0,0,0,0.2), -6px -6px 12px rgba(255,255,255,0.1);
}
.btn-secondary:hover {
    background: #d19468;
}

.btn-tertiary {
    background: transparent;
    box-shadow: none;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn-tertiary:hover {
    background: var(--primary-color);
    color: var(--white-color);
    transform: none;
    box-shadow: none;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.card {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--neumorphic-shadow);
    padding: 2rem;
    text-align: center;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card:hover {
    transform: translateY(-10px) perspective(1000px) rotateX(2deg) rotateY(-2deg);
    box-shadow: 15px 15px 30px var(--shadow-dark), -15px -15px 30px var(--shadow-light);
}

.card-image {
    margin-bottom: 1.5rem;
    border-radius: 50%; /* For instructor images */
    overflow: hidden;
    width: 150px;
    height: 150px;
    box-shadow: var(--neumorphic-inset-shadow);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Specific card image styles for non-profile images */
#talleres .card-image, #prensa .card-image {
    width: 100%;
    height: 200px;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

#premios .card-image {
    width: 120px;
    height: 120px;
}

.card-content h3 {
    color: var(--primary-color);
}

.card-content p {
    font-size: 0.95rem;
}

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

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

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(44, 62, 80, 0.7), rgba(93, 135, 179, 0.6));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 4.5rem;
    color: var(--white-color);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    max-width: 800px;
    margin: 0 auto 2rem auto;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

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

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

.timeline-item {
    padding: 1rem 40px;
    position: relative;
    width: 50%;
}
.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-color);
    border: 4px solid var(--primary-color);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
.timeline-item:nth-child(even)::after {
    left: -10px;
}

.timeline-content {
    padding: 20px 30px;
    background: var(--bg-color);
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: var(--neumorphic-shadow);
}
.timeline-item:nth-child(even) .timeline-content {
    text-align: left;
}
.timeline-item:nth-child(odd) .timeline-content {
    text-align: right;
}

/* Events Section */
.events-list {
    list-style: none;
    max-width: 900px;
    margin: 0 auto;
}
.event-item {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--neumorphic-shadow);
    transition: transform var(--transition-speed) ease;
}
.event-item:hover {
    transform: translateX(10px);
}
.event-date {
    background: var(--primary-color);
    color: var(--white-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    font-family: var(--font-heading);
    flex-shrink: 0;
}
.event-date span { display: block; }
.event-date span:first-child { font-size: 2rem; font-weight: 700; }
.event-date span:last-child { font-size: 1rem; }
.event-details { flex-grow: 1; }
.event-details h3 { margin-bottom: 0.5rem; }

/* Innovation Section */
.innovation-container {
    display: flex;
    align-items: center;
    gap: 4rem;
}
.innovation-image {
    flex: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--neumorphic-shadow);
}
.innovation-image img {
    border-radius: var(--border-radius);
}
.innovation-content {
    flex: 1;
}
.section-title-left {
    text-align: left;
}
.section-title-left::after {
    left: 0;
    transform: none;
}

/* Careers Section */
.careers-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-top: 4rem;
}
.stat-item {
    padding: 1rem;
}
.stat-number {
    display: block;
    font-size: 4rem;
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 700;
}
.stat-label {
    font-size: 1.1rem;
    color: var(--text-color);
}

/* Press (External Resources) Section */
.external-link-card {
    text-align: left;
    align-items: flex-start;
}
.external-link-card .card-content {
    width: 100%;
}
.link-more {
    display: inline-block;
    margin-top: 1rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent-color);
    position: relative;
}
.link-more::after {
    content: '→';
    margin-left: 8px;
    transition: margin-left var(--transition-speed) ease;
}
.link-more:hover::after {
    margin-left: 15px;
}

/* Contact Form */
.contact-form {
    max-width: 700px;
    margin: 2rem auto 0 auto;
}
.form-group {
    position: relative;
    margin-bottom: 2.5rem;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--border-radius);
    background: var(--bg-color);
    box-shadow: var(--neumorphic-inset-shadow);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: box-shadow var(--transition-speed) ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    box-shadow: var(--neumorphic-inset-shadow), 0 0 0 2px var(--primary-color);
}
.contact-form label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--text-color);
    transition: all var(--transition-speed) ease;
    pointer-events: none;
}
.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: -1.5rem;
    left: 0;
    font-size: 0.9rem;
    color: var(--primary-color);
}
.contact-form button {
    width: 100%;
}

/* ==========================================================================
   7. Footer
   ========================================================================== */
.footer {
    background: var(--heading-color);
    color: #bdc3c7;
    padding: 4rem 0 2rem 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}
.footer-col h3, .footer-col h4 {
    color: var(--white-color);
    font-weight: 500;
}
.footer-col ul { list-style: none; }
.footer-col a {
    color: #bdc3c7;
    transition: color var(--transition-speed) ease, padding-left var(--transition-speed) ease;
    display: inline-block;
}
.footer-col a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #3e5369;
    font-size: 0.9rem;
}

/* ==========================================================================
   8. Other Pages (Success, Privacy, etc.)
   ========================================================================== */
.success-page, .legal-page, .about-page, .contacts-page {
    background: var(--bg-color);
    padding: var(--header-height) 0;
}

.success-container {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.success-container .card {
    max-width: 600px;
}

.legal-content, .about-content, .contacts-content {
    padding: 4rem 0;
    min-height: calc(100vh - var(--header-height) - 275px); /* Adjust 275px to footer height */
}
.legal-content h1, .about-content h1, .contacts-content h1 {
    margin-bottom: 2rem;
}
.legal-content h2 {
    margin-top: 2.5rem;
}

/* ==========================================================================
   9. Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
    h1 { font-size: 3rem; }
    .hero-title { font-size: 3.5rem; }
    .innovation-container { flex-direction: column; }
}

@media (max-width: 768px) {
    :root { --header-height: 70px; }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .hero-title { font-size: 2.8rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .section { padding: 4rem 0; }

    /* Mobile Navigation */
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg-color);
        display: flex;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform var(--transition-speed) ease-in-out;
    }
    .main-nav.active {
        transform: translateX(0);
    }
    .nav-list {
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
    }
    .nav-list a { font-size: 1.5rem; }
    .burger-menu { display: block; }
    .burger-menu.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .burger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    .burger-menu.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Timeline on mobile */
    .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; }
    .timeline-item::after { left: 21px; }

    .event-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .careers-stats {
        flex-direction: column;
        gap: 2rem;
    }
}