/* ==========================================================================
   css/pages/services.css
   CONTEXT: Services Page (Interactive Reel & Wayfinding)
   ========================================================================== */

/* --- 1. Hero Section --- */
.services-hero {
    position: relative;
    padding-top: calc(var(--header-height) + 120px);
    padding-bottom: 80px;
    background-color: var(--bg-color);
    z-index: 20;
    min-height: 40vh;
    display: flex;
    align-items: flex-end;
}

.hero-text-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    width: 100%;
}

.text-hero-small {
    font-size: clamp(3.5rem, 8vw, 7rem);
    margin: 0;
    line-height: 0.9;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: var(--text-main);
}

.highlight { color: var(--accent); }

.hero-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 400px;
    margin: 0;
    border-left: 1px solid var(--accent);
    padding-left: 20px;
    line-height: 1.5;
}

/* --- 2. Horizontal Scroll Section (The Reel) --- */
.services-reel-section {
    height: 350vh; 
    padding: 0;
    background-color: #050505;
    position: relative;
    margin-top: -1px; 
}

.sticky-viewport {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* --- UI LAYER (Progress & Hints) --- */
.reel-ui-layer {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Progress Bar (The Spatial Indicator) */
.reel-progress-track {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 4px;
    background: rgba(255,255,255,0.1);
}

.reel-progress-fill {
    height: 100%; width: 0%;
    background: var(--accent);
    transition: width 0.1s linear; /* Smooth fill */
}

/* Scroll Hint (The Instruction) */
.scroll-hint {
    position: absolute;
    bottom: 40px; left: var(--gutter-x);
    display: flex; align-items: center; gap: 15px;
    opacity: 0.7;
    animation: pulseHint 3s infinite;
}

.hint-text {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem; text-transform: uppercase;
    color: var(--text-muted); letter-spacing: 0.1em;
}

.hint-line {
    width: 40px; height: 1px; background: var(--text-muted);
}

@keyframes pulseHint {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.reel-track {
    display: flex;
    padding-left: 10vw; 
    height: 70vh;
    align-items: center;
    width: max-content;
    will-change: transform;
}

/* --- 3. The Interactive Service Card --- */
.reel-card {
    position: relative;
    width: 50vw; 
    height: 100%;
    margin-right: 60px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    
    /* Anchor Tag Overrides */
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Visuals */
.card-visual {
    width: 100%;
    flex-grow: 1; 
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
    background: #111;
}

.card-visual img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: grayscale(50%) contrast(1.1);
    transition: filter 0.6s ease, transform 0.6s ease;
}

.visual-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    transition: background 0.6s ease;
}

/* --- CTA & Interaction Elements --- */

/* Wrapper for Label + Arrow */
.card-cta {
    position: absolute;
    bottom: 30px; right: 30px;
    display: flex; align-items: center; gap: 15px;
    z-index: 20;
}

.cta-label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.4s ease;
}

/* Updated Arrow */
.card-arrow {
    position: relative;
    bottom: auto; right: auto;
    width: 50px; height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    opacity: 1;
    transform: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover Interactions */
.reel-card:hover .card-visual img {
    filter: grayscale(0%) contrast(1);
    transform: scale(1.05);
}
.reel-card:hover .visual-overlay {
    background: rgba(0,0,0,0);
}

.reel-card:hover .cta-label {
    opacity: 1;
    transform: translateX(0);
}

.reel-card:hover .card-arrow {
    background: var(--accent);
    color: #000;
    transform: rotate(-45deg);
}

/* Content */
.card-content {
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 30px;
    transition: border-color 0.4s ease;
}

.reel-card:hover .card-content {
    border-left-color: var(--accent);
}

.service-num {
    display: block;
    font-family: 'Courier New', monospace;
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.service-title {
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1;
    margin-bottom: 20px;
    color: #fff;
    text-transform: uppercase;
    transition: color 0.3s ease;
}
.reel-card:hover .service-title {
    text-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.service-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 90%;
    line-height: 1.6;
}

/* Spacer for scroll end */
.reel-card.buffer {
    width: 10vw;
    margin: 0;
    pointer-events: none;
}

/* --- 4. Mobile Responsiveness --- */
@media (max-width: 1024px) {

    .services-hero,
    .services-reel-section {
        width: 100%;
        max-width: 100%;       /* Strictly limits width to parent (body) */
        overflow-x: hidden;    /* CRITICAL: Cuts off any rogue extra space */
        position: relative;    
    }

    /* 2. Ensure the Sticky Viewport doesn't leak either */
    .sticky-viewport {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    .text-hero-small {
        font-size: clamp(2.5rem, 11vw, 4rem); /* Reduced min from 3.5rem to 2.5rem */
        width: 100%;
        
        /* Safety Protocol */
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }
    .services-hero { padding-top: 140px; min-height: auto; }
    .hero-text-row { flex-direction: column; align-items: flex-start; gap: 30px; }
    .hero-desc { border-left: 2px solid var(--accent); max-width: 100%; }


    /* Disable Horizontal Scroll Layout */
    .services-reel-section {
        height: auto; 
        padding-bottom: 100px;
    }

    .service-desc, 
    .hero-desc {
        width: 100%;
        max-width: 100%;
        padding-right: 0; /* Remove potential padding conflicts */
        overflow-wrap: break-word;
    }

    .service-title {
        font-size: clamp(1.8rem, 8vw, 3rem); /* Reduced min from 2.5rem */
        line-height: 1.1;
        width: 100%;
        
        /* Safety Protocol */
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }

    .services-hero .container {
        width: 100%;
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
        overflow: visible; /* Let text flow naturally */
    }


    /* Hide Desktop UI Elements */
    .reel-ui-layer { display: none; } 

    .sticky-viewport {
        position: static;
        height: auto;
        display: block;
    }

    .reel-track {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        padding-left: 0;
        transform: none !important;
    }

    .reel-card {
        width: 100%;
        height: auto;
        margin-right: 0;
        margin-bottom: 80px;
        padding: 0 20px; 
        box-sizing: border-box;
    }
    
    .card-visual {
        height: 60vh;
    }
    
    /* Explicit Mobile CTA */
    .card-cta {
        bottom: 20px; right: 20px;
    }

    .cta-label {
        opacity: 1;
        transform: translateX(0);
        font-size: 0.8rem;
    }
    
    .card-arrow {
        background: var(--accent); /* Always accented on mobile */
        color: #000;
        width: 40px; height: 40px;
        transform: rotate(-45deg);
    }
    
    .reel-card.buffer { display: none; }

    
}
