/* =============================================================================
 * Technosense — inicio_home.css
 * -----------------------------------------------------------------------------
 * Estilos específicos de inicio.php.
 * Depende de main.css (tokens, componentes base).
 *
 * Secciones:
 *   1. Hero
 *   2. TechnoSense-Wx showcase
 *   3. Sectores
 *   4. Proceso (timeline)
 *   5. Animaciones de entrada
 * ============================================================================= */


/* ============================================================================
 * 1. HERO
 * El panel de instrumento a la derecha es la firma visual de esta página:
 * evoca un tablero de meteorología y conecta visualmente con la plataforma Wx.
 * ============================================================================ */

 .ts-hero {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: var(--sky-900);
    padding: clamp(60px, 8vw, 100px) 0;
}

/* Fondo: gradiente de cielo nocturno con detalle solar */
.ts-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 65% 110%, rgba(245, 158, 11, 0.12), transparent 60%),
        radial-gradient(ellipse 60% 80% at 10% 20%,  rgba(2, 132, 199, 0.18),  transparent 65%),
        linear-gradient(145deg, #0c4a6e 0%, #075985 50%, #0c3657 100%);
    pointer-events: none;
}

/* Layout hero: texto a la izquierda, panel a la derecha */
.ts-hero-inner {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: clamp(40px, 5vw, 80px);
    align-items: center;
    position: relative;
    z-index: 2;
}

.ts-hero-content { max-width: 580px; }

/* Eyebrow en hero (override de color para fondo oscuro) */
.ts-hero .ts-eyebrow {
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.ts-hero-title {
    font-size: clamp(2.2rem, 4.5vw, 3.75rem);
    font-weight: var(--fw-black);
    color: var(--white);
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: var(--sp-4);
}

/* Palabra de acento en solar */
.ts-hero-accent {
    color: var(--solar-500);
    display: inline-block;
}

.ts-hero-sub {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
    max-width: 500px;
    margin-bottom: var(--sp-6);
}

.ts-hero-actions {
    display: flex;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

/* ── Panel de instrumento ──────────────────────────────────────────────────── */
.ts-hero-panel {
    background: var(--white);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
}

/* Línea horizon al top del panel — firma Wx */
.ts-hero-panel::before {
    content: "";
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--sky-600), var(--solar-500));
    flex-shrink: 0;
}

.ts-hero-panel-header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.ts-hero-panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}

.ts-hero-panel-dot.live {
    background: var(--ok, #16a34a);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.ts-hero-panel-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Grid de métricas */
.ts-hero-panel-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    flex: 1;
}

.ts-metric {
    background: var(--white);
    padding: var(--sp-4) var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.ts-metric-val {
    font-family: "JetBrains Mono", "SF Mono", "Consolas", monospace;
    font-size: clamp(1.5rem, 2.5vw, 1.8rem);
    font-weight: var(--fw-bold);
    color: var(--sky-900);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.ts-metric-label {
    font-size: var(--fs-xs);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ts-hero-panel-footer {
    padding: var(--sp-4);
    border-top: 1px solid var(--line);
    background: var(--paper);
}

.ts-hero-panel-footer .btn-ts {
    width: 100%;
    justify-content: center;
}

/* ── Responsive Hero ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .ts-hero-inner {
        grid-template-columns: 1fr;
    }

    .ts-hero-panel {
        max-width: 420px;
        margin: 0 auto;
    }
}

@media (max-width: 560px) {
    .ts-hero-actions .btn-ts { width: 100%; }
}


/* ============================================================================
 * 2. TECHNOSENSE-WX SHOWCASE
 * ============================================================================ */

.ts-wx-showcase {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--sp-6);
    align-items: start;
}

/* Lista de features */
.ts-wx-features {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.ts-wx-feature {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
    padding: var(--sp-4);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}

.ts-wx-feature:hover {
    border-color: var(--sky-100);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.ts-wx-feature .ts-card-icon {
    flex-shrink: 0;
    margin-bottom: 0;
}

.ts-wx-feature h3 {
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--sky-900);
    margin-bottom: var(--sp-1);
}

.ts-wx-feature p {
    font-size: var(--fs-sm);
    color: var(--ink-soft);
    line-height: 1.6;
    margin: 0;
}

/* Card CTA de Wx */
.ts-wx-cta-card {
    position: sticky;
    top: calc(var(--header-h) + var(--sp-4));
    background: var(--sky-900);
    border-radius: var(--r-xl);
    padding: var(--sp-5);
    color: var(--white);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    min-height: 340px;
    overflow: hidden;
}

/* Línea horizon en el top */
.ts-wx-cta-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sky-600), var(--solar-500));
}

/* Detalle de fondo */
.ts-wx-cta-card::after {
    content: "";
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(245,158,11,0.15), transparent 70%);
    pointer-events: none;
}

.ts-wx-cta-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.08);
    padding: 0.3rem 0.7rem;
    border-radius: var(--r-sm);
    border: 1px solid rgba(255,255,255,0.12);
    width: fit-content;
}

.ts-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}

.ts-status-dot.live {
    background: #22c55e;
    animation: pulse-dot 2s infinite;
}

.ts-wx-cta-card h3 {
    font-size: var(--fs-lg);
    font-weight: var(--fw-black);
    color: var(--white);
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.ts-wx-cta-card p {
    color: rgba(255,255,255,0.72);
    font-size: var(--fs-sm);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.ts-wx-cta-card .btn-ts-secondary {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.15);
    position: relative;
    z-index: 1;
}

.ts-wx-cta-card .btn-ts-secondary:hover {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.3);
    color: var(--white);
}

/* ── Responsive Wx Showcase ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .ts-wx-showcase {
        grid-template-columns: 1fr;
    }

    .ts-wx-cta-card {
        position: static;
        min-height: auto;
    }
}


/* ============================================================================
 * 3. SECTORES
 * ============================================================================ */

.ts-sector-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--sp-4) var(--sp-5);
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}

.ts-sector-card:hover {
    border-color: var(--sky-100);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.ts-sector-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sky-100);
    color: var(--sky-700);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ts-sector-card h4 {
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--sky-900);
    margin-bottom: var(--sp-1);
}

.ts-sector-card p {
    font-size: var(--fs-sm);
    color: var(--ink-soft);
    line-height: 1.55;
    margin: 0;
}


/* ============================================================================
 * 4. PROCESO (TIMELINE)
 * ============================================================================ */

.ts-proceso-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-5);
    position: relative;
}

/* Línea conectora entre pasos */
.ts-proceso-grid::before {
    content: "";
    position: absolute;
    top: 28px;
    left: calc(25% / 2);
    right: calc(25% / 2);
    height: 2px;
    background: linear-gradient(90deg, var(--sky-600), var(--solar-500));
    opacity: 0.25;
    z-index: 0;
}

.ts-paso {
    position: relative;
    z-index: 1;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-sm);
    /* Animación: estado inicial */
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        border-color var(--t-base),
        box-shadow var(--t-base);
}

.ts-paso.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Escalonado de animación */
.ts-paso:nth-child(1) { transition-delay: 0.0s; }
.ts-paso:nth-child(2) { transition-delay: 0.1s; }
.ts-paso:nth-child(3) { transition-delay: 0.2s; }
.ts-paso:nth-child(4) { transition-delay: 0.3s; }

.ts-paso:hover {
    border-color: var(--sky-100);
    box-shadow: var(--shadow-md);
}

/* Línea horizon que indica secuencia */
.ts-paso::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sky-600), var(--solar-500));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* Número del paso */
.ts-paso-num {
    font-family: "JetBrains Mono", "SF Mono", "Consolas", monospace;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.1em;
    color: var(--sky-600);
    text-transform: uppercase;
    margin-bottom: var(--sp-3);
}

.ts-paso-body h3 {
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--sky-900);
    margin-bottom: var(--sp-2);
}

.ts-paso-body p {
    font-size: var(--fs-sm);
    color: var(--ink-soft);
    line-height: 1.65;
    margin: 0;
}

/* ── Responsive Proceso ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .ts-proceso-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ts-proceso-grid::before { display: none; }
}

@media (max-width: 560px) {
    .ts-proceso-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================================
 * 5. ANIMACIONES DE ENTRADA (prefers-reduced-motion safe)
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .ts-paso {
        opacity: 1;
        transform: none;
        transition: none;
    }
}


/* ============================================================================
 * SECCIÓN SOLUCIONES — TechnoSense-Wx featured card
 * ============================================================================ */

/* Card principal: layout de dos columnas (info + panel visual) */
.ts-sol-featured {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--sp-6);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
}

/* Línea horizon característica de Wx en el top */
.ts-sol-featured::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sky-600), var(--solar-500));
}

.ts-sol-featured-info {
    padding: var(--sp-6);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

/* Nombre de la plataforma — tipografía del logotipo Wx */
.ts-sol-logo-text {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: var(--fw-black);
    color: var(--sky-900);
    letter-spacing: -0.02em;
    line-height: 1;
}

.ts-sol-logo-text span {
    color: var(--solar-500);
}

.ts-sol-desc {
    font-size: var(--fs-base);
    color: var(--ink-soft);
    line-height: 1.7;
    max-width: 540px;
    margin: 0;
}

/* Lista de bullets de características */
.ts-sol-bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin: 0;
}

.ts-sol-bullets li {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--ink-soft);
}

.ts-sol-bullets li i {
    color: var(--sky-600);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.ts-sol-actions {
    display: flex;
    gap: var(--sp-3);
    flex-wrap: wrap;
    margin-top: var(--sp-2);
}

/* Panel visual derecho — fondo sky oscuro */
.ts-sol-featured-panel {
    background: var(--sky-900);
    padding: var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    position: relative;
    overflow: hidden;
}

/* Decoración radial fondo panel */
.ts-sol-featured-panel::after {
    content: "";
    position: absolute;
    bottom: -50px; right: -50px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(245,158,11,0.14), transparent 70%);
    pointer-events: none;
}

.ts-sol-panel-header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    color: rgba(255,255,255,0.65);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ts-sol-panel-badge {
    margin-left: auto;
    background: rgba(245,158,11,0.2);
    color: var(--solar-500);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--r-sm);
    padding: 0.15rem 0.5rem;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.06em;
}

/* Grid de módulos de la plataforma */
.ts-sol-panel-modules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
    flex: 1;
}

.ts-sol-module {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    /* Estado: inactivo/próximamente */
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.35);
}

.ts-sol-module i {
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Estado: activo */
.ts-sol-module.active {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
}

.ts-sol-module.active i {
    color: var(--solar-500);
}

.ts-sol-access-btn {
    width: 100%;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Placeholder próximas soluciones */
.ts-sol-coming {
    margin-top: var(--sp-6);
    padding: var(--sp-4) var(--sp-5);
    border: 1px dashed var(--line);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    background: var(--paper);
}

.ts-sol-coming-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.ts-sol-coming p {
    font-size: var(--fs-sm);
    color: var(--ink-soft);
    margin: 0;
}

.ts-sol-coming p a {
    color: var(--sky-600);
    font-weight: var(--fw-medium);
}

/* ── Responsive Soluciones ───────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .ts-sol-featured {
        grid-template-columns: 1fr;
    }
    .ts-sol-featured-panel {
        /* En móvil el panel va arriba del texto */
        order: -1;
        padding: var(--sp-4);
    }
    .ts-sol-panel-modules {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 560px) {
    .ts-sol-panel-modules {
        grid-template-columns: repeat(2, 1fr);
    }
    .ts-sol-coming {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-2);
    }
    .ts-sol-actions { flex-direction: column; }
    .ts-sol-actions .btn-ts { width: 100%; justify-content: center; }
}


/* ============================================================================
 * SECCIÓN PROYECTOS — cards por sector
 * ============================================================================ */

.ts-proy-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    /* Animación entrada */
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        border-color var(--t-base),
        box-shadow var(--t-base);
}

.ts-proy-card:nth-child(1) { transition-delay: 0.00s; }
.ts-proy-card:nth-child(2) { transition-delay: 0.08s; }
.ts-proy-card:nth-child(3) { transition-delay: 0.16s; }
.ts-proy-card:nth-child(4) { transition-delay: 0.24s; }
.ts-proy-card:nth-child(5) { transition-delay: 0.32s; }
.ts-proy-card:nth-child(6) { transition-delay: 0.40s; }

.ts-proy-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.ts-proy-card:hover {
    border-color: var(--sky-100);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.ts-proy-card.in-view:hover {
    transform: translateY(-4px);
}

.ts-proy-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sky-100);
    color: var(--sky-700);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ts-proy-card h3 {
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--sky-900);
    margin: 0;
}

.ts-proy-card p {
    font-size: var(--fs-sm);
    color: var(--ink-soft);
    line-height: 1.65;
    margin: 0;
    flex: 1;
}

.ts-proy-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    color: var(--sky-600);
    text-decoration: none;
    margin-top: auto;
    transition: gap var(--t-fast), color var(--t-fast);
}

.ts-proy-link:hover {
    color: var(--sky-900);
    gap: var(--sp-3);
}

/* Botón "ver todos" centrado */
.ts-proy-cta {
    margin-top: var(--sp-6);
    text-align: center;
}


/* ── prefers-reduced-motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ts-proy-card,
    .ts-paso {
        opacity: 1;
        transform: none;
        transition: none;
    }
}