@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&display=swap');

:root {
    --b-bg: #000000;
    --b-card: #0a0a0a;
    --b-accent: #ffffff;
    --b-text-main: #ffffff;
    --b-text-dim: rgba(255, 255, 255, 0.6);
    --b-border: rgba(255, 255, 255, 0.06);

    /* Nueva Curva de animación profesional (Quartic Out) */
    --b-ease: cubic-bezier(0.25, 1, 0.5, 1);
    --b-transition-slow: 1s var(--b-ease);
    --b-transition-fast: 0.2s ease-out;
}

.medical-bento {
    padding: 120px 5%;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--b-text-main);
    overflow: hidden;
}

.bento-container {
    display: grid;
    max-width: 1400px;
    margin: 0 auto;
    gap: 30px;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 520px 380px;
    perspective: 2000px;
}

/* --- CLASES DE IMÁGENES --- */
.node-mision {
    grid-column: span 2;
    background-image:
        linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4)),
        url('/assets/imgs/mkt2026.png');
    background-position: top !important;
}

.node-vision {
    grid-column: span 2;
    background-image:
        linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4)),
        url('/assets/imgs/mesa.png');
}

.node-valores {
    grid-column: span 4;
    background-image:
        linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.6)),
        url('/assets/imgs/coms.png');
}

/* Base de Tarjeta Cinemática */
.bento-node {
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: 44px;
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform, opacity, filter;
    transition:
        transform 0.6s var(--b-ease),
        border-color 0.4s ease,
        box-shadow 0.6s var(--b-ease);
}

/* Efecto Luz Interactiva (Spotlight) */
.bento-node::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        600px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.08),
        transparent 40%
    );
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.bento-node:hover::before {
    opacity: 1;
}

.bento-node:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Capas de Legibilidad Profunda */
.node-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 20%, transparent 80%);
    z-index: 1;
    transition: opacity 0.4s ease;
}

/* Contenido flotante 3D */
.node-content {
    position: relative;
    z-index: 3;
    height: 100%;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transform: translateZ(50px) scale(0.95);
    transition: transform 0.6s var(--b-ease);
}

.bento-node:hover .node-content {
    transform: translateZ(80px) scale(1);
}

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: auto;
    border-bottom: 1px solid var(--b-border);
    padding-bottom: 20px;
    transform: translateZ(20px);
}

.node-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 700;
    color: var(--b-text-dim);
    position: relative;
}

/* Línea animada en el tag al hacer hover */
.node-tag::after {
    content: '';
    position: absolute;
    bottom: -22px; left: 0; width: 0; height: 1px;
    background: var(--b-accent);
    transition: width 0.4s var(--b-ease);
}

.bento-node:hover .node-tag::after {
    width: 100%;
}

.node-number { font-family: monospace; font-size: 0.9rem; opacity: 0.3; }

.node-title {
    font-size: 3.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin: 25px 0;
    letter-spacing: -3px;
    line-height: 0.9;
    transform: translateZ(30px);
}

.node-text {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--b-text-dim);
    max-width: 580px;
    transform: translateZ(10px);
    transition: color 0.4s ease;
}

.bento-node:hover .node-text {
    color: var(--b-text-main);
}

/* Grid de Valores Dinámico */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 40px;
    transform: translateZ(10px);
}

.values-grid span {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--b-border);
    padding: 15px;
    text-align: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
    transition: all 0.3s var(--b-ease);
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo rápido en valores al hover */
.values-grid span::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.5s var(--b-ease);
}

.values-grid span:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-5px) scale(1.05);
}

.values-grid span:hover::after {
    left: 100%;
}

/* --- ANIMACIÓN DE ENTRADA CINEMÁTICA --- */
.reveal {
    opacity: 0;
    filter: blur(20px);
    transform: translateY(80px) scale(0.9) rotateX(-10deg);
    will-change: transform, opacity, filter;
}

.reveal.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1) rotateX(0deg);
    transition:
        opacity 1.2s var(--b-ease),
        filter 1.2s var(--b-ease),
        transform 1.2s var(--b-ease);
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1100px) {
    .node-title { font-size: 2.8rem; }
    .node-content { padding: 40px; }
    .bento-container {
        grid-template-rows: 460px 340px;
    }
}

@media (max-width: 900px) {
    .bento-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 20px;
    }
    .bento-node {
        grid-column: span 1 !important;
        height: auto;
        min-height: 450px;
    }
    .medical-bento { padding: 60px 20px; }
    .node-title { font-size: 2.4rem; letter-spacing: -2px; }
    .node-text { font-size: 1rem; }
    .values-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 600px) {
    .medical-bento { padding: 40px 16px; }
    .node-content { padding: 28px; }
    .bento-node { min-height: 360px; border-radius: 28px; }
    .node-title { font-size: 2rem; letter-spacing: -1px; }
    .node-text { font-size: 0.95rem; }
    .values-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-top: 24px;
    }
    .values-grid span { padding: 10px 8px; font-size: 0.78rem; }
}

@media (max-width: 380px) {
    .values-grid { grid-template-columns: repeat(2, 1fr); }
    .node-title { font-size: 1.7rem; }
}