/* Index — Motion-Driven body (tokens Urabasoft). Solo transform/opacity. */

/* —— Scroll reveal —— */
@media (prefers-reduced-motion: no-preference) {
    .home-reveal {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity 0.55s ease, transform 0.55s ease;
    }

    .home-reveal--from-left {
        transform: translateX(-20px);
    }

    .home-reveal--from-right {
        transform: translateX(20px);
    }

    .home-reveal--visible {
        opacity: 1 !important;
        transform: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-reveal {
        opacity: 1;
        transform: none;
    }
}

.section-eyebrow {
    display: inline-block;
    margin-bottom: 0.65rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--color-accent);
    background: rgba(3, 105, 161, 0.08);
    border: 1px solid rgba(3, 105, 161, 0.18);
    border-radius: 999px;
}

/* —— Proof / trust —— */
.home-proof {
    position: relative;
    overflow: hidden;
}

.home-proof::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(3, 105, 161, 0.04), transparent);
    pointer-events: none;
}

.trust-stat {
    position: relative;
}

.trust-stat__bar {
    width: 36px;
    height: 3px;
    margin: 0 auto 0.85rem;
    border-radius: 999px;
    background: rgba(3, 105, 161, 0.15);
    overflow: hidden;
}

.trust-stat__bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-accent), var(--cyan-accent));
    transition: width 0.9s ease;
}

.home-live .trust-stat__bar i {
    width: 100%;
}

.trust-stat strong {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* —— Featured —— */
.home-featured {
    position: relative;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.featured-frame {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(3, 105, 161, 0.12);
}

.featured-frame img {
    width: 100%;
    height: auto;
    display: block;
    transform: scale(1);
    transition: transform 0.6s ease;
}

.home-live .featured-frame img {
    animation: home-img-drift 10s ease-in-out infinite alternate;
}

@keyframes home-img-drift {
    0% { transform: scale(1); }
    100% { transform: scale(1.04); }
}

.featured-frame__scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #38bdf8, transparent);
    opacity: 0;
    pointer-events: none;
}

.home-live .featured-frame__scan {
    animation: home-scan 3.5s ease-in-out infinite;
}

@keyframes home-scan {
    0% { top: 6%; opacity: 0; }
    12% { opacity: 0.9; }
    88% { opacity: 0.9; }
    100% { top: 94%; opacity: 0; }
}

.featured-frame__glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(3, 105, 161, 0.12) 0%, transparent 55%);
    pointer-events: none;
}

.featured-chip {
    position: absolute;
    z-index: 2;
    padding: 0.35rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #fff;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.featured-chip--1 { top: 14px; right: 14px; }
.featured-chip--2 { bottom: 14px; left: 14px; }

.home-live .featured-chip--1 {
    animation: home-chip-float 4.2s ease-in-out infinite;
}

.home-live .featured-chip--2 {
    animation: home-chip-float 4.8s ease-in-out infinite 0.5s;
}

@keyframes home-chip-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.benefit-list {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    text-align: left;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.benefit-item:hover {
    border-color: rgba(3, 105, 161, 0.35);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.benefit-item__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(3, 105, 161, 0.1);
    color: var(--color-accent);
}

.benefit-item p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.benefit-item strong {
    color: var(--color-primary);
}

/* —— Services —— */
.home-services {
    background: var(--color-background);
    position: relative;
}

.home-services::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(3, 105, 161, 0.2), transparent);
}

.section-title-wrap {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 2.75rem;
}

.section-title-wrap .section-eyebrow {
    margin-bottom: 0.75rem;
}

.section-title-wrap .section-title {
    margin-bottom: 0.65rem;
}

.section-title-wrap p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.home-svc-card {
    overflow: hidden;
    padding: 0;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.home-svc-card .icon,
.home-svc-card h3,
.home-svc-card p {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
}

.home-svc-card .icon {
    margin-top: 1.25rem;
}

.home-svc-card h3 {
    margin-top: 1rem;
}

.home-svc-card p {
    margin-bottom: 1.5rem;
}

.home-svc-stage {
    position: relative;
    height: 120px;
    background: linear-gradient(180deg, #f1f5f9 0%, #e8eef5 100%);
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
}

.home-svc-stage *,
.home-svc-stage *::before,
.home-svc-stage *::after {
    animation-play-state: paused;
}

.home-live .home-svc-stage *,
.home-live .home-svc-stage *::before,
.home-live .home-svc-stage *::after {
    animation-play-state: running;
}

/* Escena: bloques de código */
.scene-home-code {
    padding: 18px 20px;
    display: grid;
    gap: 8px;
}

.scene-home-code span {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: #cbd5e1;
    transform-origin: left;
    animation: home-code-line 2.4s ease-in-out infinite;
}

.scene-home-code span:nth-child(1) { width: 55%; background: var(--color-accent); }
.scene-home-code span:nth-child(2) { width: 78%; animation-delay: 0.15s; }
.scene-home-code span:nth-child(3) { width: 42%; animation-delay: 0.3s; }
.scene-home-code span:nth-child(4) { width: 65%; animation-delay: 0.45s; }

@keyframes home-code-line {
    0%, 100% { transform: scaleX(0.45); opacity: 0.5; }
    50% { transform: scaleX(1); opacity: 1; }
}

/* Escena: navegador */
.scene-home-web {
    width: min(200px, 72%);
    margin: 16px auto 0;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.scene-home-web__bar {
    height: 14px;
    background: #0f172a;
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0 7px;
}

.scene-home-web__bar i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #38bdf8;
    display: block;
}

.scene-home-web__body {
    padding: 10px;
    display: grid;
    gap: 6px;
}

.scene-home-web__body b {
    display: block;
    height: 8px;
    border-radius: 3px;
    background: #e2e8f0;
    animation: home-web-slide 2.6s ease-in-out infinite;
}

.scene-home-web__body b:nth-child(1) { width: 68%; background: var(--color-accent); }
.scene-home-web__body b:nth-child(2) { width: 100%; animation-delay: 0.12s; }
.scene-home-web__body b:nth-child(3) { width: 48%; animation-delay: 0.24s; }

@keyframes home-web-slide {
    0%, 100% { transform: translateX(-8px); opacity: 0.4; }
    50% { transform: translateX(0); opacity: 1; }
}

/* Escena: nodos automatización */
.scene-home-auto {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
}

.scene-home-auto span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(3, 105, 161, 0.15);
    animation: home-node-pulse 2s ease-in-out infinite;
}

.scene-home-auto span:nth-child(2) { animation-delay: 0.35s; }
.scene-home-auto span:nth-child(3) { animation-delay: 0.7s; }

.scene-home-auto::before,
.scene-home-auto::after {
    content: "";
    position: absolute;
    top: 50%;
    height: 2px;
    width: 28px;
    background: linear-gradient(90deg, var(--color-accent), transparent);
    transform: translateY(-50%);
    animation: home-link-flow 2s ease-in-out infinite;
}

.scene-home-auto::before { left: calc(50% - 42px); }
.scene-home-auto::after {
    right: calc(50% - 42px);
    background: linear-gradient(270deg, var(--color-accent), transparent);
    animation-delay: 0.35s;
}

@keyframes home-node-pulse {
    0%, 100% { transform: scale(0.85); opacity: 0.65; }
    50% { transform: scale(1.15); opacity: 1; }
}

@keyframes home-link-flow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.home-svc-card:hover {
    transform: translateY(-3px);
}

/* —— Projects teaser —— */
.home-teaser {
    position: relative;
    overflow: hidden;
}

.home-teaser__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 900px) {
    .home-teaser__inner {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

.home-teaser__mosaic {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 1.25rem;
    background: #0f172a;
    border-radius: 16px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.home-teaser__mosaic::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: inherit;
    pointer-events: none;
}

.home-teaser__cell {
    aspect-ratio: 1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0.35;
    transform: scale(0.92);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.home-live .home-teaser__cell {
    animation: home-cell-glow 4.4s ease-in-out infinite;
}

.home-teaser__cell:nth-child(1) { animation-delay: 0s; }
.home-teaser__cell:nth-child(2) { animation-delay: 0.2s; }
.home-teaser__cell:nth-child(3) { animation-delay: 0.4s; }
.home-teaser__cell:nth-child(4) { animation-delay: 0.6s; }
.home-teaser__cell:nth-child(5) { animation-delay: 0.8s; }
.home-teaser__cell:nth-child(6) { animation-delay: 1s; }
.home-teaser__cell:nth-child(7) { animation-delay: 1.2s; }
.home-teaser__cell:nth-child(8) { animation-delay: 1.4s; }
.home-teaser__cell:nth-child(9) { animation-delay: 1.6s; }
.home-teaser__cell:nth-child(10) { animation-delay: 1.8s; }
.home-teaser__cell:nth-child(11) { animation-delay: 2s; grid-column: span 2; aspect-ratio: 2 / 1; }

@keyframes home-cell-glow {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.92);
        background: rgba(255, 255, 255, 0.06);
    }
    50% {
        opacity: 1;
        transform: scale(1);
        background: rgba(3, 105, 161, 0.55);
        border-color: rgba(56, 189, 248, 0.45);
    }
}

.home-teaser__label {
    position: absolute;
    bottom: 12px;
    left: 14px;
    z-index: 2;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #38bdf8;
}

.home-teaser__copy h2 {
    font-size: clamp(1.65rem, 3.5vw, 2.1rem);
}

.home-teaser__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1rem 0 1.25rem;
}

.home-teaser__stats span {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-accent);
    background: rgba(3, 105, 161, 0.08);
    border: 1px solid rgba(3, 105, 161, 0.15);
    border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
    .featured-frame img,
    .featured-frame__scan,
    .featured-chip,
    .home-teaser__cell,
    .scene-home-code span,
    .scene-home-web__body b,
    .scene-home-auto span,
    .scene-home-auto::before,
    .scene-home-auto::after {
        animation: none !important;
    }

    .home-svc-card:hover {
        transform: none;
    }
}
