/* ============================================================
   CORPOAUTÓNOMA — CSS Design System
   Inspired by edge.studio + Corpoautónoma branding
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
    /* Colors — Corpoautónoma Blue palette */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F8FC;
    --bg-dark: #0A2540;
    --bg-card: #F0F5FA;

    --text-primary: #1A1A2E;
    --text-secondary: #555566;
    --text-light: #8899AA;
    --text-on-dark: #F0F5FA;

    --accent-blue: #0077B6;
    --accent-blue-hover: #005F92;
    --accent-blue-light: #48CAE4;
    --accent-teal: #00B4D8;
    --accent-teal-dark: #0096C7;
    --accent-coral: #FF6B6B;
    --accent-gradient: linear-gradient(135deg, #0077B6 0%, #00B4D8 100%);

    /* Typography */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --section-padding: clamp(80px, 12vw, 160px);
    --container-width: 1200px;
    --container-padding: clamp(20px, 4vw, 60px);

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: 0.3s var(--ease-out-expo);
    --transition-medium: 0.6s var(--ease-out-expo);
    --transition-slow: 1s var(--ease-out-expo);

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 50px;
    --radius-round: 50%;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    /* Lenis handles this */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-blue);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

::selection {
    background: var(--accent-blue);
    color: white;
}

/* ---- Utility Classes ---- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   HEADER & NAVIGATION — Edge Studio Collapse Effect
   Logo is SEPARATE from the nav pill.
   Nav pill has a white background that visually shrinks on scroll.
   ============================================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 12px var(--container-padding);
}

.header-top {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 8px;
    transition: opacity 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo), height 0.4s var(--ease-out-expo);
}

.header.collapsed .header-top {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.header-contact {
    display: flex;
    gap: 24px;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.header-contact a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.header-contact a:hover {
    color: var(--accent-blue);
}

/* ---- Navbar Row — holds logo + nav pill side by side ---- */
.navbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ---- Logo — standalone, separate from nav pill ---- */
.logo {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}

.logo:hover {
    color: var(--text-primary);
}

.header.collapsed .logo {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
}

/* ---- Nav Pill — white bg, SEPARATE from logo, shrinks on scroll ---- */
.nav-pill {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-pill);
    padding: 6px 6px 6px 6px;
    transition: all 0.6s var(--ease-out-expo);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.header.collapsed .nav-pill {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
}

/* ---- Nav links — visible when expanded, collapses to 0 ---- */
.nav-links {
    display: flex;
    gap: 0;
    align-items: center;
    overflow: hidden;
    /* The max-width + padding animate to create the "closing" effect */
    max-width: 600px;
    padding-left: 10px;
    opacity: 1;
    transition: max-width 0.6s var(--ease-out-expo),
        opacity 0.35s var(--ease-out-expo),
        padding 0.6s var(--ease-out-expo);
}

.header.collapsed .nav-links {
    max-width: 0;
    padding-left: 0;
    opacity: 0;
    pointer-events: none;
}

.nav-link {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    position: relative;
    padding: 10px 18px;
    white-space: nowrap;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-link:last-child {
    border-right: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--accent-blue);
    transform: scaleX(0);
    transition: transform var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* ---- Nav actions (right side, always visible) ---- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

/* ---- Hamburger button — hidden at top, appears on collapse ---- */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    width: 0;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-round);
    background: transparent;
    transition: all 0.4s var(--ease-out-expo);
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.header.collapsed .hamburger {
    opacity: 1;
    width: 44px;
    overflow: visible;
    pointer-events: all;
}

.hamburger:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.35s var(--ease-out-expo), opacity 0.35s var(--ease-out-expo);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---- Contact button ---- */
.btn-contact {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-blue);
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: background var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
}

.btn-contact:hover {
    background: var(--accent-blue-hover);
    transform: scale(1.03);
}

/* ---- Arrow button ---- */
.btn-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-round);
    background: var(--bg-dark);
    color: white;
    transition: transform var(--transition-fast), background var(--transition-fast);
    flex-shrink: 0;
}

.btn-arrow:hover {
    transform: scale(1.05);
    background: #333;
}

/* ---- Dropdown Menu ---- */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: var(--container-padding);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 0;
    width: 260px;
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.35s var(--ease-out-expo), transform 0.35s var(--ease-out-expo);
    overflow: hidden;
}

.dropdown-menu.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.dropdown-menu-content {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.dropdown-link {
    display: block;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    transition: background var(--transition-fast), color var(--transition-fast), padding-left var(--transition-fast);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dropdown-link:last-child {
    border-bottom: none;
}

.dropdown-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    padding-left: 36px;
}


/* ============================================================
   HERO SLIDER SECTION
   ============================================================ */
.hero-slider {
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    /* Align the whole container to the bottom */
    position: relative;
    padding: 120px var(--container-padding) 0;
    /* no bottom padding so images touch floor */
    overflow: hidden;
    /* mostly white with animated light blue effects */
    background: linear-gradient(120deg, #ffffff 0%, #ffffff 40%, rgba(0, 180, 216, 0.15) 50%, rgba(0, 119, 182, 0.1) 60%, #ffffff 100%);
    background-size: 300% 300%;
    animation: waveGlow 15s ease infinite alternate;
}

@keyframes waveGlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

.hero-slider-container {
    /* Allow the hero to expand up to 1500px on very wide screens to take advantage of the space */
    max-width: clamp(1200px, 90vw, 1500px);
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.slide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: flex-end;
    /* Align slide content to the bottom */
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    transition: opacity 0.6s var(--ease-out-expo);
}

.slide.active {
    opacity: 1;
    position: relative;
    pointer-events: all;
}

.slide-content {
    /* Scale gracefully from 520px up to 650px on ultra wide screens */
    max-width: clamp(520px, 45vw, 650px);
    position: relative;
    z-index: 10;
    padding-bottom: 60px;
    /* space between text and floor */
}

.slide-title {
    font-family: var(--font-heading);
    /* Allow font to scale up to 72px on huge screens */
    font-size: clamp(36px, 4.5vw, 76px);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.slide-description {
    /* Allow text to scale up nicely on large screens */
    font-size: clamp(14px, 1.2vw, 20px);
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
    max-width: 500px; /* Let it breathe horizontally a bit more */
}

.slide-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-blue);
    color: white;
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 4px 20px rgba(0, 119, 182, 0.3);
}

.slide-cta:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 119, 182, 0.4);
    color: white;
}

.slider-nav {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.slider-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(0, 119, 182, 0.2);
    background: transparent;
    color: var(--accent-blue);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-arrow:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    transform: scale(1.05);
}

.slide-visual {
    position: relative;
    display: flex;
    align-items: flex-end;
    /* Align to bottom instead of center */
    justify-content: center;
    min-height: clamp(500px, 65vh, 900px);
}

.slide-image-wrapper {
    position: relative;
    /* Increased v-width/v-height percentage so it scales up starting at 1200px screens */
    width: clamp(650px, 55vw, 1100px);
    height: clamp(600px, 75vh, 1000px);
    z-index: 2;
    overflow: visible;
}

/* Floor gradient for Cut-off images (Slider 2 & 3) */
.slide[data-slide="1"] .slide-image-wrapper::after,
.slide[data-slide="2"] .slide-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 10%;
    width: 80%;
    height: 60px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 1;
    pointer-events: none;
    transform: scaleY(0.3);
}

.slide-image-wrapper img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    transition: transform 0.6s ease;
    transform-origin: bottom center;
}

.slide.active .slide-image-wrapper img {
    animation: imageGlide 15s ease-in-out infinite alternate;
}

@keyframes imageGlide {
    0% {
        transform: translate(-10px, 0);
    }

    100% {
        transform: translate(15px, 0);
    }
}

/* ---- Floating Decorative Elements ---- */
.deco-element {
    position: absolute;
    z-index: 1;
    /* Keep them behind content */
    transition: transform 0.4s var(--ease-out-expo);
    cursor: pointer;
}

.deco-element:hover {
    transform: scale(1.3) rotate(15deg) !important;
}

.deco-circle-gradient {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B 0%, #00B4D8 50%, #6B5B95 100%);
    animation: floatSlow 6s ease-in-out infinite;
}

.deco-circle-gradient.small {
    width: 35px;
    height: 35px;
}

.deco-ring-teal {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--accent-teal);
    background: transparent;
    animation: floatMedium 5s ease-in-out infinite reverse;
}

.deco-ring-teal.small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.deco-arc {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: #FF6B6B;
    border-right-color: #00B4D8;
    border-bottom-color: #6B5B95;
    background: transparent;
    animation: spinSlow 8s linear infinite;
}

.deco-arc.large {
    width: 70px;
    height: 70px;
    border-width: 6px;
}

.deco-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-teal);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

@keyframes floatMedium {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    33% {
        transform: translateY(-10px) translateX(5px);
    }

    66% {
        transform: translateY(5px) translateX(-5px);
    }
}

@keyframes spinSlow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.6;
    }
}

/* ---- Slider Navigation ---- */
.slider-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}

.slider-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-primary);
    font-size: 18px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.slider-arrow:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    transform: scale(1.08);
}

@media (max-width: 768px) {
    .hero-slider {
        padding-top: 100px;
    }

    .slide {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .slide-content {
        max-width: 100%;
    }

    .slide-description {
        max-width: 100%;
    }

    .slide-visual {
        min-height: 350px;
    }

    .slide-image-wrapper {
        width: 280px;
        height: 340px;
    }

    .slide-shield-bg {
        width: 250px;
        height: 310px;
    }

    .slide-gradient-circle {
        width: 220px;
        height: 220px;
    }

    .slider-nav {
        justify-content: center;
    }

    .deco-element {
        display: none;
    }
}

/* ============================================================
   MARQUEE SECTION
   ============================================================ */
.marquee-section {
    overflow: hidden;
    padding: 40px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.marquee-content {
    display: flex;
    align-items: center;
    gap: 40px;
    padding-right: 40px;
    font-family: var(--font-heading);
    font-size: clamp(32px, 5vw, 64px);
    color: var(--text-primary);
    letter-spacing: 4px;
    white-space: nowrap;
}

.marquee-dot {
    font-size: 14px;
    color: var(--accent-blue);
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ============================================================
   VIDEO TEXT MASK REVEAL SECTION
   ============================================================ */
.video-mask-section {
    position: relative;
    height: 300vh;
    /* Extra height for scroll pinning */
    background: #f5f5f5;
    z-index: 2; /* Stay above the services section background */
}

.video-mask-wrapper {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.video-mask-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: 1;
}

.video-mask-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    transform-origin: center center;
    will-change: transform, opacity;
}

.video-mask-svg {
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 768px) {
    .video-mask-section {
        height: 200vh;
    }
}

/* ============================================================
   SERVICES SECTION — PINNED SCROLL
   ============================================================ */
.services-pinned {
    position: relative;
    height: 500vh;
    background-color: #fdfdfd;
    overflow: clip; /* Clips circles without breaking sticky positioning */
    z-index: 1;
}

/* Background Animated Shapes Container — full viewport width */
.services-bg-anim {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background-color: #fdfdfd;
}

/* Background Video for Services */
.services-video-bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    pointer-events: none;
    z-index: 0;
}

/* Vanta.js 3D Background for Services */
.services-vanta-bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

/* Three.js City Model Canvas */
.services-city-canvas {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100vh;
    z-index: 0;
    display: block;
}



/* Formas sólidas organizadas concéntricamente desde la derecha */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    top: 50%;
    transform-origin: center center;
}

/* Forma 1: Onda azul clarito — cubre TODO el ancho sobrepasando la izquierda */
.bg-shape.shape-1 {
    width: 220vw;
    height: 220vw;
    right: -60vw;
    background: #e0f2fe;
    animation: waveBreathe1 15s infinite alternate ease-in-out;
}

/* Forma 2: Onda celeste — cubre casi todo */
.bg-shape.shape-2 {
    width: 170vw;
    height: 170vw;
    right: -45vw;
    background: #7dd3fc;
    animation: waveBreathe2 18s infinite alternate ease-in-out;
}

/* Forma 3: Onda azul intenso */
.bg-shape.shape-3 {
    width: 120vw;
    height: 120vw;
    right: -30vw;
    background: #0ea5e9;
    animation: waveBreathe3 16s infinite alternate ease-in-out;
}

/* Forma 4: Onda azul oscuro en la esquina derecha */
.bg-shape.shape-4 {
    width: 70vw;
    height: 70vw;
    right: -15vw;
    background: #0284c7;
    animation: waveBreathe4 20s infinite alternate ease-in-out;
}

/* Animaciones: Crecen y se desplazan de derecha a izquierda y regresan */
@keyframes waveBreathe1 {
    0% { transform: translateY(-50%) translateX(5vw) scale(0.95); }
    100% { transform: translateY(-50%) translateX(-10vw) scale(1.05); }
}

@keyframes waveBreathe2 {
    0% {
        transform: translateY(-50%) translateX(3vw) scale(0.95);
    }

    100% {
        transform: translateY(-50%) translateX(-8vw) scale(1.08);
    }
}

@keyframes waveBreathe3 {
    0% {
        transform: translateY(-50%) translateX(4vw) scale(0.95);
    }

    100% {
        transform: translateY(-50%) translateX(-12vw) scale(1.1);
    }
}

@keyframes waveBreathe4 {
    0% {
        transform: translateY(-50%) translateX(8vw) scale(0.95);
    }

    100% {
        transform: translateY(-50%) translateX(-15vw) scale(1.15);
    }
}

.services-pinned-container {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: stretch;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    overflow: visible;
}

/* ---- Left side: Curved numbers ---- */
.services-left {
    position: absolute;
    left: calc(-1 * var(--container-padding, 40px));
    /* This pushes it out of the padding right to the screen edge */
    top: 0;
    width: 200px;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* Hide the old ::before */
.services-left::before {
    display: none;
}

/* Container for numbers — positioned relative */
.services-step-indicator {
    position: relative;
    width: 100%;
    height: 100%;
}

/* SVG curved line */
.services-arc-line {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    /* Prevent clipping for negative coordinates */
}

.services-arc-line path {
    fill: none;
    stroke: rgba(0, 0, 0, 0.12);
    stroke-width: 1;
}

/* Each number positioned explicitly on the curve */
.step-number {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.3); /* Blanco semi-transparente para los inactivos */
    line-height: 1;
    letter-spacing: -2px;
    transition: color 0.4s ease, transform 0.6s ease, opacity 0.6s ease;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    transform: translateY(-50%);
    /* EXACT center alignment */
}

/* Positions along a perfect parabola — extremely close to the left edge */
.step-number[data-step="0"] {
    left: -60px;
    top: 15%;
}

.step-number[data-step="1"] {
    left: -22.5px;
    top: 32.5%;
}

.step-number[data-step="2"] {
    left: -10px;
    top: 50%;
}

.step-number[data-step="3"] {
    left: -22.5px;
    top: 67.5%;
}

.step-number[data-step="4"] {
    left: -60px;
    top: 85%;
}

.step-number.active {
    color: #ffffff;
    font-size: 52px;
}

/* Dot marker before each number */
.step-number::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    transition: background 0.4s ease;
}

.step-number.active::before {
    background: #ffffff;
}

.step-progress-track,
.step-progress-fill {
    display: none;
}

/* ---- Right side: Content panels ---- */
.services-right {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    margin-left: 120px;
    position: relative;
    overflow: visible;
    /* changed from hidden to let child margin-right break out */
    height: 100vh;
}

.services-panels-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.service-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    /* Center vertically instead of stretch */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.service-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* ---- Left column: Text content ---- */
.panel-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 0;
}

.panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 16px;
}

.panel-subtitle {
    font-size: 16px;
    color: #e2e8f0; /* Blanco azulado suave */
    font-weight: 500;
    margin-bottom: 24px;
    max-width: 95%;
    line-height: 1.6;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.08;
    letter-spacing: -1.5px;
    margin-bottom: 12px;
    color: #ffffff;
    font-weight: 800;
}

/* Decorative line under title */
.panel-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    border-radius: 2px;
    margin-top: 18px;
    margin-bottom: 24px;
}

.panel-description p {
    font-size: 16px;
    color: #cbd5e1; /* Gris claro para lectura */
    font-weight: 500;
    line-height: 1.7;
    margin-bottom: 14px;
}

.panel-description p:last-child {
    margin-bottom: 0;
}

/* ---- Right column: Image touching the right edge ---- */
.panel-image-container {
    position: relative;
    overflow: hidden;
    height: 70vh;
    border-radius: 20px; /* Redondeado por todos lados */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    margin: 0; 
}

.panel-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.panel-image-card {
    position: absolute;
    bottom: 40px;
    left: 20px;
    /* Offset it to overlay on the left side of the image */
    background: rgba(30, 41, 59, 0.85); /* Box oscuro translúcido */
    color: #ffffff; /* Letra blanca en el texto del box */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 22px 28px;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 210px;
    z-index: 10;
}

.card-line {
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    border-radius: 2px;
}

.card-text {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .services-pinned {
        height: 500vh;
    }

    .services-left {
        display: none;
    }

    .services-right {
        margin-left: 0;
        height: 100vh;
    }

    .service-panel {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .panel-text {
        padding: 30px 20px;
        order: 1;
    }

    .panel-image-container {
        order: 2;
        height: 40vh;
    }

    .panel-title {
        font-size: clamp(24px, 6vw, 36px);
        margin-bottom: 10px;
    }

    .panel-title::after {
        margin-top: 12px;
        margin-bottom: 16px;
    }

    .panel-subtitle {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .panel-description p {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .panel-image-card {
        bottom: 20px;
        left: 15px;
        padding: 14px 18px;
        min-width: 160px;
    }

    .card-text {
        font-size: 14px;
    }
}

/* ============================================================
   ABOUT / ACERCA DE NOSOTROS SECTION
   ============================================================ */
.about-section {
    padding: clamp(60px, 8vw, 100px) var(--container-padding);
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.about-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(30px, 4vw, 70px);
    align-items: center;
}

/* ---- Left column: Photo + Decorations ---- */
.about-left {
    position: relative;
}

.about-photo-wrapper {
    position: relative;
    padding: 40px 60px 70px 20px;
}

.about-photo {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 620px;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.15);
    display: block;
}

/* Decorative vectors acting as base for the photo */
.about-base {
    position: absolute;
    border-radius: 20px; /* Bordes suaves */
    z-index: 1;
}

/* El bloque gris inmenso que sostiene toda la estructura, a la derecha y abajo */
.about-base-gray {
    width: 90%;
    height: 90%;
    background-color: #E2E2E2; /* Gris acorde a la imagen */
    bottom: -30px;
    right: -40px;
}

/* El bloque azul vibrante asomando en la esquina superior derecha */
.about-base-blue {
    width: 65%;
    height: 70%;
    background-color: #3843E6; /* Azul profundo / índigo vibrante de la imagen */
    top: -20px;
    right: -20px;
}

/* Social media banner — Amarillo sólido, texto e iconos negros */
.about-social-banner {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background-color: #FFDE15; /* Amarillo vibrante brillante de la imagen */
    padding: 16px 25px;
    border-radius: 10px;
    bottom: -15px;
    right: 20px; /* Posicionado sobre la esquina inferior derecha de la foto */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.social-banner-label {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    color: #000000;
}

.social-banner-icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.social-banner-icons a {
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.social-banner-icons a:hover {
    transform: scale(1.2);
    opacity: 0.7;
}

/* ---- Right column: Text ---- */
.about-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Etiqueta / Badge azul solido */
.about-badge {
    display: inline-block;
    padding: 8px 18px;
    background: #3843E6; /* Mismo color azul de la base */
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 6px;
    margin-bottom: 25px;
}

.about-title {
    font-family: var(--font-heading);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: #111111;
    margin-bottom: 20px;
}

/* Gray line under the title */
.about-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #d1d1d1; /* Línea gris de la imagen */
    margin-top: 25px;
    margin-bottom: 10px;
}

.about-description {
    font-size: 16px;
    line-height: 1.8;
    color: #555555;
    margin-bottom: 35px;
    max-width: 480px;
}

.about-description strong {
    color: #111111;
    font-weight: 700;
}

/* Botón sólido azul */
.about-cta {
    display: inline-block;
    padding: 16px 40px;
    background: #3843E6;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(56, 67, 230, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.about-cta:hover {
    transform: translateY(-3px);
    background: #2b35c2;
    box-shadow: 0 14px 35px rgba(56, 67, 230, 0.4);
    color: #ffffff;
}

/* ---- About section responsive ---- */
@media (max-width: 768px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-photo-wrapper {
        padding: 20px 30px 50px 0;
    }

    .about-photo {
        max-width: 100%;
    }

    .about-social-banner {
        margin-left: 10px;
    }

    .about-title {
        font-size: clamp(28px, 7vw, 42px);
    }

    .about-description {
        max-width: 100%;
    }
}

/* ============================================================
   PROJECTS SECTION (Edge.studio horizontal carousel)
   ============================================================ */
.projects {
    padding: clamp(60px, 8vw, 120px) 0;
    background: #f3f4f6;
    overflow: hidden;
}

.projects-header {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    margin-bottom: 50px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: -40px;
    margin-bottom: 0;
}

/* ---- Carousel ---- */
.projects-carousel-viewport {
    width: 100%;
    overflow: hidden;
}

.projects-carousel-track {
    display: flex;
    gap: 30px;
    padding: 0 var(--container-padding);
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ---- Card ---- */
.project-card {
    flex: 0 0 calc(33.333% - 20px); /* 3 cards visible at a time */
    min-width: 360px;
    cursor: pointer;
}

/* Image container — tall by default, shrinks on hover */
.project-card-image {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    transition: height 0.55s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.55s cubic-bezier(0.25, 1, 0.5, 1);
}

/* On hover: image SHRINKS to about half height, photo zooms slightly */
.project-card:hover .project-card-image {
    height: 260px;
}

.project-card:hover .project-card-image img {
    transform: scale(1.04);
}

/* Tag pills floating on top of the image */
.project-tags {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tags span {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.25);
}

/* Info section BELOW the image */
.project-card-info {
    padding: 20px 8px 10px;
}

.project-date {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 6px;
}

.project-title {
    font-family: var(--font-heading);
    font-size: clamp(24px, 2.5vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    color: #111111;
    margin-bottom: 0;
    transition: transform 0.45s ease;
}

/* Description + link hidden by default, appear on hover */
.project-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.25, 1, 0.5, 1),
                opacity 0.4s ease 0.1s,
                margin 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50px;
    text-decoration: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.25, 1, 0.5, 1),
                opacity 0.4s ease 0.15s,
                margin 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.3);
}

.project-link:hover {
    background: linear-gradient(135deg, #0369a1, #0ea5e9);
    box-shadow: 0 8px 25px rgba(2, 132, 199, 0.45);
    color: #ffffff;
}

/* On hover: title shifts up, desc + button cascade in */
.project-card:hover .project-title {
    transform: translateY(-4px);
}

.project-card:hover .project-desc {
    max-height: 120px;
    opacity: 1;
    margin-top: 14px;
}

.project-card:hover .project-link {
    max-height: 60px;
    opacity: 1;
    margin-top: 18px;
}

/* ---- Pagination ---- */
.projects-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
}

.pagination-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #0284c7;
    background: transparent;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-arrow:hover {
    background: #0284c7;
    color: #ffffff;
}

.pagination-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pagination-dot.active {
    background: #0284c7;
    color: #ffffff;
}

.pagination-dot:hover:not(.active) {
    color: #0284c7;
}

/* Progress line under the active dot */
.pagination-progress {
    width: 40px;
    height: 3px;
    background: #0284c7;
    border-radius: 2px;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .project-card {
        flex: 0 0 280px;
        height: 420px;
    }

    .project-image-text {
        font-size: 32px;
    }

    .project-bottom h3 {
        font-size: 22px;
    }
}

/* ============================================================
   TEACHERS SECTION
   ============================================================ */
.teachers {
    padding: clamp(60px, 8vw, 120px) 0;
    background: #000000;
}

.teachers-header {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    margin-bottom: 50px;
}

.teachers-header .about-title {
    color: #ffffff;
}

/* Grid: 3 cards side by side */
.teachers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Override project-card flex sizing inside this grid */
.teachers-grid .project-card {
    flex: unset;
    min-width: unset;
}

/* White text for title/date in the dark section */
.teachers-grid .project-title {
    color: #ffffff;
}

.teachers-grid .project-date {
    color: rgba(255,255,255,0.5);
}

.teachers-grid .project-desc {
    color: #94a3b8;
}

@media (max-width: 900px) {
    .teachers-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   PRICING / PLANS SECTION
   ============================================================ */
.pricing {
    padding: clamp(60px, 8vw, 120px) var(--container-padding);
    background: #f3f4f6;
}

.pricing-header {
    max-width: var(--container-width);
    margin: 0 auto;
    text-align: center;
    margin-bottom: 60px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Card base */
.pricing-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.4s ease;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

/* Featured card */
.pricing-card--featured {
    background: linear-gradient(135deg, #0c1d36, #1e3a5f);
    border: 2px solid #38bdf8;
    color: #ffffff;
}

.pricing-card--featured .pricing-name,
.pricing-card--featured .pricing-frequency,
.pricing-card--featured .detail-number,
.pricing-card--featured .detail-label {
    color: #ffffff;
}

.pricing-card--featured .pricing-icon {
    color: #38bdf8;
}

.pricing-card--featured .pricing-btn {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #ffffff;
    border: none;
}

.pricing-card--featured .pricing-divider {
    background: rgba(255,255,255,0.2);
}

/* Badge for popular */
.pricing-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 22px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Icon */
.pricing-icon {
    color: #0284c7;
    margin-bottom: 20px;
}

/* Name */
.pricing-name {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 6px;
}

/* Frequency */
.pricing-frequency {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

/* Details row */
.pricing-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.pricing-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-number {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    color: #111111;
    line-height: 1;
}

.detail-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1.5px;
    margin-top: 4px;
}

.pricing-divider {
    width: 1px;
    height: 50px;
    background: rgba(0,0,0,0.1);
}

/* CTA Button */
.pricing-btn {
    display: inline-block;
    padding: 14px 32px;
    border: 2px solid #0284c7;
    color: #0284c7;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
}

.pricing-btn:hover {
    background: #0284c7;
    color: #ffffff;
}

@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   TEREM 3D SCROLL SECTION  — 3-phase vector animation
   ============================================================ */

/* CSS variables driven by JS scroll progress */
:root {
    --tp1: 0; /* Fase 1: Vector izquierdo aparece */
    --tp2: 0; /* Fase 2: Vector derecho */
    --tp3: 0; /* Fase 3: Expansión del círculo + texto */
    --tp4: 0; /* Fase 4: Fondo negro → blanco */
}

.terem-section {
    position: relative;
    height: 900vh; /* Extended for 4 phases */
    background: #0f0f0f;
}

#terem-canvas {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: block;
}

/* Sticky overlay that sits on top of the canvas */
.terem-overlay {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    margin-top: -100vh;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* FASE 1 — Vector izquierdo (triángulo blanco desde la izquierda) */
.tv-vector-left {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #f0f0f0;
    z-index: 1;
    opacity: calc(1 - var(--tp2));
    clip-path: polygon(
        0% 0%,
        calc(var(--tp1) * 50%) calc(var(--tp1) * 50%),
        calc(var(--tp1) * 100%) calc(var(--tp1) * 100%),
        0% 100%
    );
    /* Show text inside the white panel */
    display: flex;
    align-items: center;
    padding-left: 6%;
    overflow: hidden;
}

/* Text block inside the left vector */
.tv-text-block {
    max-width: 380px;
    opacity: calc((var(--tp1) - 0.3) * 2);
    transform: translateY(calc(20px - (var(--tp1) * 20px)));
    pointer-events: none;
    clip-path: inset(0);
}

/* Push text block lower so it appears in the visible area of the diagonal */
.tv-text-block--lower {
    margin-top: 40px;
}

/* CTA button — dark style (on white panels) */
.tv-cta-btn {
    display: inline-block;
    margin-top: 22px;
    padding: 12px 28px;
    background: #111111;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 50px;
    pointer-events: all;
    transition: background 0.25s, transform 0.2s;
}

.tv-cta-btn:hover {
    background: #333;
    transform: translateY(-2px);
}

/* CTA button — light style (on black background fase 3) */
.tv-cta-btn--light {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.7);
    color: #fff;
}

.tv-cta-btn--light:hover {
    background: rgba(255,255,255,0.15);
}


.tv-title {
    font-family: var(--font-heading);
    font-size: clamp(22px, 2.8vw, 42px);
    font-weight: 800;
    color: #111111;
    line-height: 1.2;
    margin-top: 10px;
}

/* Badge estilo referencia: píldora con gradiente morado */
.tv-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50px;
    padding: 6px 18px;
    margin-bottom: 4px;
}

/* Variant for dark background (fase 3) */
.tv-badge-light {
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.5);
    color: #fff;
}

/* FASE 2 — Vector derecho con texto alineado a la derecha */
.tv-vector-right {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #f0f0f0;
    z-index: 2;
    opacity: calc(var(--tp2) * (1 - var(--tp3)));
    clip-path: polygon(
        100% 0%,
        100% 100%,
        calc(100% - (var(--tp2) * 50%)) calc(100% - (var(--tp2) * 50%)),
        calc(100% - (var(--tp2) * 100%)) 0%
    );
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8%;
    overflow: hidden;
}

.tv-text-right {
    text-align: right;
    opacity: calc((var(--tp2) - 0.3) * 2);
    transform: translateY(calc(20px - (var(--tp2) * 20px)));
}

/* FASE 3 — Nodo central que crece y cubre la pantalla */
.tv-node-container {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%)
               scale(calc(var(--tp1) * (1 + var(--tp3) * 40)))
               rotate(calc(var(--tp2) * 90deg));
    z-index: 20;
    width: 160px;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tv-hollow-center {
    width: 90px;
    height: 90px;
    background-color: #000;
    border: calc(4px / (1 + var(--tp3) * 20)) solid #ffffff;
    border-radius: 50%;
}

/* FASE 3 — Texto que aparece cuando el círculo cubre la pantalla */
.tv-final-content {
    position: absolute;
    z-index: 30;
    text-align: center;
    /* Fades in with tp3, then fades out as tp4 starts */
    opacity: calc(var(--tp3) * (1 - var(--tp4)));
    transform: translateY(calc(30px - (var(--tp3) * 30px)));
    pointer-events: none;
}

/* FASE 4 — Fondo blanco que aparece sobre el negro */
.tv-white-overlay {
    position: absolute;
    inset: 0;
    background: #f8f8f8;
    z-index: 35;
    opacity: var(--tp4);
    pointer-events: none;
}

/* FASE 4 — Contenido sobre el fondo blanco */
.tv-final-content-4 {
    position: absolute;
    z-index: 40;
    text-align: center;
    opacity: var(--tp4);
    transform: translateY(calc(30px - (var(--tp4) * 30px)));
    pointer-events: none;
}

.tv-title-dark {
    font-family: var(--font-heading);
    font-size: clamp(24px, 3.5vw, 52px);
    font-weight: 800;
    color: #111111;
    line-height: 1.2;
    margin-top: 14px;
}

.terem-title {
    font-family: var(--font-heading);
    font-size: clamp(24px, 3.5vw, 52px);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin-top: 14px;
}


/* ============================================================
   METHOD SECTION (formerly STATS)
   ============================================================ */
.method-section {
    padding: clamp(60px, 8vw, 120px) var(--container-padding);
    background: #ffffff;
}

.method-container {
    max-width: var(--container-width);
    margin: 0 auto;
}

.method-header {
    margin-bottom: 60px;
}

/* Two-column layout */
.method-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 80px;
}

/* Left column: Image with decorative shapes */
.method-image-col {
    position: relative;
}

.method-deco-circle {
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    z-index: 0;
}

.method-deco-blob {
    position: absolute;
    top: 10%;
    left: -40px;
    width: 120px;
    height: 300px;
    border-radius: 60px;
    background: linear-gradient(180deg, #4f46e5, #0ea5e9);
    z-index: 0;
}

.method-photo {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

/* Right column: Description + Steps */
.method-steps-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.method-intro {
    font-size: 15px;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 10px;
}

.method-intro strong {
    color: #111111;
}

/* Step card */
.method-step {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.method-step.visible {
    opacity: 1;
    transform: translateY(0);
}

.method-step:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

/* Stagger animation delays */
.method-step[data-step="1"] { transition-delay: 0s; }
.method-step[data-step="2"] { transition-delay: 0.15s; }
.method-step[data-step="3"] { transition-delay: 0.3s; }

.method-step-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #ede9fe;
    color: #6d28d9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.method-step-content h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: #111111;
    margin-bottom: 6px;
}

.method-step-content p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Stats grid (kept below) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast);
}

.stat-item:hover {
    transform: translateY(-4px);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: clamp(48px, 6vw, 72px);
    color: var(--text-primary);
    letter-spacing: -1px;
    display: block;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 8px;
    display: block;
}

@media (max-width: 768px) {
    .method-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .method-image-col {
        order: -1;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   FOCUS SECTION
   ============================================================ */
.focus-section {
    padding: var(--section-padding) var(--container-padding);
}

.focus-container {
    max-width: var(--container-width);
    margin: 0 auto;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.focus-card {
    padding: 48px 36px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.focus-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-medium);
}

.focus-card:hover::before {
    transform: scaleX(1);
}

.focus-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.1);
}

.focus-icon {
    color: var(--accent-teal);
    margin-bottom: 28px;
    transition: transform var(--transition-fast);
}

.focus-card:hover .focus-icon {
    transform: scale(1.1);
}

.focus-title {
    font-family: var(--font-heading);
    font-size: 36px;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.focus-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 24px;
}

.focus-link {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent-blue);
    transition: letter-spacing var(--transition-fast);
}

.focus-link:hover {
    letter-spacing: 1.5px;
    color: var(--accent-blue-hover);
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials {
    padding: var(--section-padding) var(--container-padding);
    background: var(--bg-secondary);
}

.testimonials-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.testimonials-slider {
    position: relative;
    min-height: 300px;
    overflow: hidden;
}

.testimonial-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
    pointer-events: none;
}

.testimonial-card.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
    position: relative;
}

.testimonial-quote {
    color: var(--accent-blue);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.testimonial-text {
    font-size: clamp(18px, 2.5vw, 22px);
    line-height: 1.7;
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 32px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-round);
    background: var(--accent-teal);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.testimonial-author strong {
    display: block;
    font-size: 15px;
}

.testimonial-author span {
    font-size: 13px;
    color: var(--text-light);
}

.testimonial-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-round);
    background: rgba(0, 0, 0, 0.12);
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.dot.active {
    background: var(--accent-blue);
    transform: scale(1.2);
}

.dot:hover {
    background: var(--accent-blue);
}

/* ============================================================
   BLOG SECTION
   ============================================================ */
.blog-section {
    padding: var(--section-padding) var(--container-padding);
}

.blog-container {
    max-width: var(--container-width);
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.blog-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    color: inherit;
}

.blog-image {
    height: 200px;
    transition: transform var(--transition-medium);
}

.blog-card:hover .blog-image {
    transform: scale(1.05);
}

.blog-content {
    padding: 28px;
}

.blog-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-teal);
    padding: 4px 12px;
    border: 1px solid var(--accent-teal);
    border-radius: var(--radius-pill);
    margin-bottom: 14px;
}

.blog-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
}

.blog-date {
    font-size: 13px;
    color: var(--text-light);
}

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-section {
    padding: var(--section-padding) var(--container-padding);
    background: var(--bg-dark);
    text-align: center;
}

.cta-container {
    max-width: 700px;
    margin: 0 auto;
}

.cta-title {
    font-family: var(--font-heading);
    font-size: clamp(56px, 10vw, 120px);
    color: var(--text-on-dark);
    letter-spacing: 2px;
    line-height: 1;
    margin-bottom: 40px;
}

.cta-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.cta-text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cta-text {
    font-size: 17px;
    color: rgba(232, 228, 223, 0.7);
    margin-bottom: 40px;
    line-height: 1.8;
    max-width: 500px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* CTA QR Box */
.cta-qr-box {
    margin-top: 10px;
    padding: 24px 30px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    transition: background 0.3s, transform 0.3s;
}

.cta-qr-box:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-4px);
}

.qr-link {
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: var(--text-on-dark);
}

.qr-placeholder {
    width: 60px;
    height: 60px;
    background: white;
    color: var(--bg-dark);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-label {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* On desktop, put text and QR side by side */
@media (min-width: 768px) {
    .cta-content-wrapper {
        flex-direction: row;
        justify-content: center;
        text-align: left;
    }
    .cta-text-content {
        align-items: flex-start;
    }
    .cta-buttons {
        justify-content: flex-start;
    }
    .cta-qr-box {
        margin-top: 0;
    }
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 15px;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.cta-btn.primary {
    background: var(--accent-blue);
    color: white;
}

.cta-btn.primary:hover {
    background: var(--accent-blue-hover);
    transform: scale(1.03);
    color: white;
}

.cta-btn.primary svg {
    transition: transform var(--transition-fast);
}

.cta-btn.primary:hover svg {
    transform: translate(3px, -3px);
}

.cta-btn.secondary {
    background: transparent;
    color: var(--text-on-dark);
    border: 1px solid rgba(232, 228, 223, 0.3);
}

.cta-btn.secondary:hover {
    background: rgba(232, 228, 223, 0.08);
    border-color: rgba(232, 228, 223, 0.5);
    color: var(--text-on-dark);
    transform: scale(1.03);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--bg-dark);
    color: var(--text-on-dark);
    padding: 80px var(--container-padding) 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-brand-name {
    font-family: var(--font-heading);
    font-size: 28px;
    letter-spacing: 2px;
}

.footer-nav {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.footer-col a {
    font-size: 14px;
    color: rgba(232, 228, 223, 0.6);
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: var(--text-on-dark);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    font-size: 13px;
    color: rgba(232, 228, 223, 0.4);
}

.footer-social {
    display: flex;
    gap: 16px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-round);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(232, 228, 223, 0.6);
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.social-link:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    transform: translateY(-3px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .stats-intro {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .focus-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}

@media (max-width: 768px) {

    /* On mobile: always collapsed style */
    .header-top {
        display: none;
    }

    .logo {
        opacity: 0 !important;
        transform: translateX(-20px) !important;
        pointer-events: none;
    }

    .nav-links {
        max-width: 0 !important;
        padding-left: 0 !important;
        opacity: 0 !important;
        pointer-events: none;
    }

    .hamburger {
        opacity: 1 !important;
        width: 44px !important;
        overflow: visible !important;
        pointer-events: all !important;
    }

    .nav-pill {
        padding: 6px !important;
    }

    .dropdown-menu {
        width: calc(100vw - 2 * var(--container-padding));
        right: var(--container-padding);
    }


    .hero {
        min-height: 80vh;
        padding-top: 100px;
    }

    .hero-line-1,
    .hero-line-2 {
        font-size: clamp(60px, 18vw, 120px);
    }

    .timeline-line {
        left: 20px;
    }

    .service-block {
        flex-direction: column;
        gap: 20px;
        padding-left: 50px;
    }

    .service-number-side {
        position: absolute;
        left: -30px;
        min-width: auto;
    }

    .service-num-big {
        font-size: 48px;
    }

    .services-cta {
        margin-left: 0;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-top {
        flex-direction: column;
    }

    .footer-nav {
        gap: 40px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .clients-grid {
        grid-template-columns: 1fr;
    }

    .focus-grid {
        max-width: 100%;
    }
}

/* ============================================================
   FLOATING WHATSAPP BUTTON
   ============================================================ */
.floating-wa {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
    z-index: 10000;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    text-decoration: none;
}

/* Pulse ring */
.floating-wa::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.5);
    animation: wa-pulse 2s infinite;
}

@keyframes wa-pulse {
    0%   { transform: scale(1); opacity: 0.8; }
    70%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* Tooltip */
.floating-wa::after {
    content: 'Escríbenos';
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.floating-wa:hover::after {
    opacity: 1;
}

.floating-wa:hover {
    transform: scale(1.12) translateY(-4px);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.55);
}

.floating-wa svg {
    display: block;
    flex-shrink: 0;
}

/* ---- Ensure btn-contact works as an anchor too ---- */
a.btn-contact {
    cursor: pointer;
}