/* =================================================================
   WEB.CSS
   Página de servicios Web & Diseño
   ================================================================= */

/* -----------------------------------------------------------------
   IMPORTS - Sistema Modular
   ----------------------------------------------------------------- */
@import url('styles/_tokens.css');
@import url('styles/_reset.css');
@import url('styles/_nav.css');
@import url('styles/_components.css');
@import url('styles/_utilities.css');

/* -----------------------------------------------------------------
   PAGE-SPECIFIC STYLES
   ----------------------------------------------------------------- */

/* Animación Text Reveal */
.reveal-text span {
    opacity: 0.1;
    transition: opacity 0.5s;
}

.reveal-text span.active {
    opacity: 1;
}

/* Tech Stack Marquee */
.tech-marquee-wrap {
    overflow: hidden;
    display: flex;
    gap: var(--space-16);
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}

.tech-marquee {
    display: flex;
    gap: var(--space-16);
    animation: scrollLeft 40s linear infinite;
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Speed Circle Animation */
.speed-circle {
    transition: stroke-dashoffset 2s ease-out;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

/* Sticky Section Transition */
.sticky-image {
    transition: all 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-2xl);
}

.sticky-image.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    z-index: 10;
}

/* Mobile Image Reveal */
.mobile-image-reveal {
    transition: opacity 0.5s ease;
}

/* -----------------------------------------------------------------
   STACKING CARDS
   ----------------------------------------------------------------- */
.stack-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 10vh;
}

.stack-card {
    position: sticky;
    top: 120px;
    margin: 0 auto 5vh auto;
    width: 100%;
    max-width: 1200px;
    min-height: 70vh;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.15);
    transform-origin: center top;
    transition: transform 0.5s ease;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .stack-card {
        flex-direction: row;
        min-height: 550px;
    }
}

/* Z-index */
.stack-card:nth-child(1) {
    z-index: 1;
}

.stack-card:nth-child(2) {
    z-index: 2;
}

.stack-card:nth-child(3) {
    z-index: 3;
}

/* Contenido */
.stack-card .card-content {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

@media (min-width: 768px) {
    .stack-card .card-content {
        padding: var(--space-12);
    }
}

@media (min-width: 1024px) {
    .stack-card .card-content {
        padding: var(--space-16);
        width: 50%;
    }
}

.stack-card .card-visual {
    flex: 1;
    position: relative;
    min-height: 300px;
}

@media (min-width: 1024px) {
    .stack-card .card-visual {
        width: 50%;
        min-height: auto;
    }
}

/* Tipografía unificada */
.stack-card h2,
.stack-card h3 {
    font-size: var(--text-h2);
    font-weight: var(--font-extrabold);
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--space-4);
}

@media (min-width: 768px) {

    .stack-card h2,
    .stack-card h3 {
        margin-bottom: var(--space-6);
    }
}

.stack-card p {
    font-size: var(--text-small);
    line-height: var(--leading-normal);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-6);
    color: var(--text-secondary);
}

@media (min-width: 768px) {
    .stack-card p {
        font-size: var(--text-body);
        line-height: 1.7;
    }
}

@media (min-width: 1024px) {
    .stack-card p {
        font-size: var(--text-body-lg);
        line-height: var(--leading-relaxed);
        margin-bottom: 0;
    }
}

/* Tags unificados */
.stack-card .phase-tag,
.stack-card .tech-tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-micro);
    font-weight: var(--font-bold);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    margin-right: var(--space-2);
    margin-bottom: var(--space-2);
}

@media (min-width: 768px) {

    .stack-card .phase-tag,
    .stack-card .tech-tag {
        font-size: var(--text-caption);
        padding: var(--space-2) var(--space-4);
    }
}

/* Mobile optimizations */
@media (max-width: 767px) {
    .stack-card {
        top: 100px;
        margin-bottom: var(--space-6) !important;
        min-height: auto;
    }

    .stack-card .card-content {
        padding: var(--space-6) !important;
    }
}

/* -----------------------------------------------------------------
   MOBILE SLIDER TRANSFORMATION
   ----------------------------------------------------------------- */
@media (max-width: 1023px) {
    .horizontal-track {
        animation: none !important;
        width: 100% !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 2rem;
        /* Space for scrollbar/touch */
        padding-left: 1.5rem;
        /* Left padding for first item */
        padding-right: 1.5rem;
        /* Right padding for last item */
    }

    .portfolio-card {
        scroll-snap-align: center;
        min-width: 85vw;
        margin-right: 1rem;
    }

    /* Hide duplicates (marquee items) on mobile */
    .portfolio-card:nth-child(n+4) {
        display: none;
    }

    /* Hide scrollbar */
    .horizontal-track::-webkit-scrollbar {
        display: none;
    }

    .horizontal-track {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}