/* RAFAEL DONADIO - Professional Authority Stylesheet
   Version: 2.0 (Final & Optimized)
   Concept: High-Impact Tech Architecture & Extraordinary Ability Validation
*/

:root {
    /* MODO CLARO (Default Light) */
    --bg: #ffffff;
    --text: #111111;
    --accent: #007AFF;
    --accent-hover: #0056b3;
    --secondary: #666666;
    --card-bg: #f5f5f7;
    --border: #e1e1e1;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --shadow: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    /* MODO OSCURO (Premium Authority) */
    --bg: #050505;
    --text: #f5f5f7;
    --accent: #00D1FF;
    --accent-hover: #33dbff;
    --secondary: #a1a1a6;
    --card-bg: #121212;
    --border: #2c2c2e;
    --nav-bg: rgba(5, 5, 5, 0.8);
    --shadow: rgba(0, 0, 0, 0.5);
}

/* --- RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- NAVIGATION --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2000;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* --- HERO SECTION --- */
.hero {
    padding: 200px 0 100px;
    text-align: center;
}

.badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 2rem;
}

h1 {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--secondary);
    max-width: 800px;
    margin: 0 auto 3rem;
}

/* --- BUTTONS --- */
.cta-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.3s, background 0.3s;
    display: inline-block;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-3px);
    background: var(--accent-hover);
}

.btn-secondary {
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--card-bg);
}

/* --- AUTHORITY SECTION (Refined for Equal Height) --- */
.authority-section {
    padding: 120px 0;
}

.authority-grid {
    display: grid;
    /* Mantenemos la proporción actual o puedes usar 1fr 1fr para igualdad total */
    grid-template-columns: 1fr 1.2fr; 
    gap: 80px;
    
    /* CAMBIO CLAVE: Fuerza a ambos contenedores (imagen y texto) 
       a estirarse hasta ocupar toda la altura del contenedor más alto. */
    align-items: stretch;
}

.authority-image-conceptual {
    /* Mantenemos tus estilos visuales del borde y fondo */
    background-color: #000; /* Placeholder negro visible en tu imagen */
    background-image: url('tu-imagen-conceptual.jpg'); /* ASEGÚRATE DE USAR TU IMAGEN AQUÍ */
    background-size: cover; /* Mantiene proporción, recorta si es necesario */
    background-position: center;
    background-repeat: no-repeat;
    
    border-radius: 28px;
    box-shadow: 0 40px 80px var(--shadow);
    border: 1px solid var(--border); /* El borde visible en tu captura */
    
    /* CAMBIO CLAVE 2: Eliminamos cualquier 'height' fijo.
       La altura ahora la define el Grid Stretching. */
    height: auto; 
    
    /* Opcional: Añade un min-height para asegurar que la imagen 
       tenga presencia si el texto de la derecha es muy corto. */
    min-height: 450px; 
    
    transition: transform 0.4s ease;
}

.authority-image-conceptual:hover {
    transform: scale(1.02);
}

.authority-image .profile-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 40px var(--shadow);
    display: block;
}

.authority-text h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.authority-text {
    /* AJUSTE ESTÉTICO OPCIONAL: 
       Como el contenedor de texto ahora se estira para igualar a la imagen, 
       usamos Flexbox para centrar verticalmente el *contenido del texto* dentro de su caja estirada. */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0; /* Espaciado interno opcional */
}

/* Mantenemos el comportamiento responsivo para móviles */
@media (max-width: 968px) {
    .authority-grid {
        grid-template-columns: 1fr;
        gap: 50px;
        align-items: start; /* No estirar en móvil, apilar naturalmente */
    }
    
    .authority-image-conceptual {
        min-height: 350px; /* Altura específica para móvil */
        order: -1; /* Mantener imagen arriba */
    }
    
    .authority-text {
        padding: 0;
    }
}


.lead {
    font-size: 1.4rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.quote-box {
    margin-top: 3rem;
    padding: 2.5rem;
    background: var(--card-bg);
    border-left: 5px solid var(--accent);
    border-radius: 0 20px 20px 0;
}

.quote {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.quote-author {
    font-weight: 700;
    color: var(--secondary);
    font-size: 0.9rem;
}

/* --- TRUST BAR --- */
#trust-bar {
    padding: 60px 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

#trust-bar p {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary);
    margin-bottom: 30px;
}

.logos-grid {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    opacity: 0.6;
    filter: grayscale(1);
}

.logo-item {
    font-weight: 800;
    font-size: 1.2rem;
}

/* --- IMPACT PILLARS --- */
.impact-section {
    padding: 120px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 4rem;
}

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

.impact-card {
    text-align: center; /* Centra todo el contenido de la tarjeta para mejor equilibrio visual */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.impact-card .icon {
    font-size: 3.5rem; /* Un poco más grande para impacto */
    margin: 0 auto 25px auto;
    display: block;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
}

.impact-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
}


.impact-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.impact-card p {
    color: var(--secondary);
}

/* --- INTERACTIVE ELEMENTS --- */
select, #themeToggle {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

/* --- RESPONSIVE --- */
@media (max-width: 968px) {
    .authority-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 50px;
    }
    
    .quote-box {
        border-left: none;
        border-top: 5px solid var(--accent);
        border-radius: 0 0 20px 20px;
    }

    .nav-links {
        display: none;
    }
    
    h1 {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .cta-group .btn {
        width: 100%;
    }
}

.pillar-metrics {
    text-align: left; /* Mantenemos la lista a la izquierda para legibilidad */
    width: 100%;
}

.pillar-metrics li {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.pillar-metrics li::before {
    content: "→";
    margin-right: 8px;
}

/* --- CUSTOM LANGUAGE SWITCHER (Pill Style) --- */
.lang-switcher-pill {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 3px;
    gap: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--secondary);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-btn:hover {
    color: var(--text);
}

.lang-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 209, 255, 0.3);
}

/* --- CASE STUDIES SECTION (Bento Style) --- */
.cases-section {
    padding: 120px 0;
    border-top: 1px solid var(--border);
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

.case-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 50px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
}

/* Efecto de resplandor sutil al pasar el mouse */
.case-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.case-tag {
    display: inline-block;
    background: rgba(0, 209, 255, 0.1);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
}

.case-card h3 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.case-card p {
    font-size: 1.1rem;
    color: var(--secondary);
    line-height: 1.7;
}

/* Decoración visual de fondo para las tarjetas (AIO Aesthetic) */
.case-card::after {
    content: "";
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.05;
    pointer-events: none;
}

/* --- FOOTER IMPROVEMENTS --- */
footer {
    background: var(--card-bg);
    padding: 100px 0 40px;
}

.footer-inner h2 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
}

.footer-bottom {
    margin-top: 80px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--secondary);
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .cases-grid {
        grid-template-columns: 1fr;
    }
    
    .case-card {
        padding: 35px;
        min-height: auto;
    }

    .footer-inner h2 {
        font-size: 2.2rem;
    }
}

/* --- MEJORA DE PILLARS (SOLUCIÓN AL ESPACIADO) --- */

.impact-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 28px;
    display: flex;
    flex-direction: column; /* Alinea body arriba y footer abajo */
    height: 100%;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-body {
    padding: 50px 40px 40px; /* Más espacio inferior */
    text-align: center;
    flex-grow: 1; /* Empuja el footer hacia abajo */
}

.card-footer {
    padding: 25px 40px;
    background: rgba(0, 209, 255, 0.05); /* Fondo sutil para separar */
    border-top: 1px solid var(--border); /* Línea divisoria clara */
}

/* Ajuste de las métricas en azul */
.pillar-metrics {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pillar-metrics li {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent); /* Tu color Light Blue */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.pillar-metrics li:last-child {
    margin-bottom: 0;
}

.pillar-metrics li::before {
    content: "→";
    margin-right: 12px;
    font-weight: 900;
}

/* --- CASE STUDIES ENHANCEMENTS --- */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
}

.case-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: all 0.4s ease;
}

.case-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 25px 50px var(--shadow);
}

/* Reutilizamos las clases del Pillar para mantener consistencia */
.case-card .card-body {
    padding: 45px 40px 35px;
    flex-grow: 1;
}

.case-card .card-footer {
    padding: 25px 40px;
    background: rgba(0, 209, 255, 0.05); /* El mismo Light Blue suave */
    border-top: 1px solid var(--border);
}

.case-tag {
    display: inline-block;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

/* --- FOOTER & CONTACT ENHANCEMENTS --- */
footer {
    padding: 100px 0 50px;
    background: var(--card-bg);
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-inner p {
    font-size: 1.2rem;
    color: var(--secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

.footer-cta {
    margin-bottom: 60px;
}

/* Redes Sociales */
.social-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

.social-links a {
    text-decoration: none;
    color: var(--secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.social-links svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease, stroke 0.3s ease;
}

.social-links span {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    opacity: 0.7;
}

/* Hover Effects */
.social-links a:hover {
    color: var(--accent);
}

.social-links a:hover svg {
    transform: translateY(-5px);
    stroke: var(--accent);
}

.social-links a:hover span {
    opacity: 1;
}

.footer-bottom {
    padding-top: 40px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    opacity: 0.5;
}

@media (max-width: 600px) {
    .social-links {
        gap: 25px;
    }
}

/* --- LOGOS GRID AS LINKS --- */

.logos-grid a.logo-item {
    text-decoration: none; /* Elimina el subrayado */
    color: inherit;        /* Mantiene el color gris/blanco del diseño */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    cursor: pointer;
}

/* Efecto Hover: Cambio de color al azul de autoridad y leve elevación */
.logos-grid a.logo-item:hover {
    color: var(--accent); 
    transform: translateY(-3px);
    opacity: 1; /* Asegura visibilidad total al pasar el mouse */
}

/* Opcional: añade un ligero brillo para resaltar la interactividad */
.logos-grid a.logo-item:active {
    transform: scale(0.95);
}