/* Components CSS - Navbar, Hero, Buttons, Cards */

/* --- Lambda page transition (navigation only; never an initial-load blocker) --- */
#elysium-preloader {
    position: fixed;
    inset: 0;
    background-color: var(--color-bg-primary);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    contain: paint;
    transform: translateZ(0);
    transition: opacity 0.16s ease, visibility 0s linear 0.16s;
}

#elysium-preloader.is-leaving {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

#elysium-preloader .preloader-content {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.92);
    transition: opacity 0.14s ease, transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#elysium-preloader.is-leaving .preloader-content {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.preloader-lambda {
    display: inline-block;
    font-size: 8rem;
    font-weight: 200;
    font-family: -apple-system, sans-serif;
    color: transparent;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.1) 30%, #fff 50%, rgba(255, 255, 255, 0.1) 70%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    position: relative;
    filter: drop-shadow(0 0 28px rgba(41, 151, 255, 0.55));
}

#elysium-preloader.is-leaving .preloader-lambda {
    animation:
        lambda-navigation-pulse 0.8s infinite alternate ease-in-out,
        lambda-navigation-shine 0.85s linear infinite;
    will-change: transform;
}

@keyframes lambda-navigation-pulse {
    0% {
        transform: translateZ(0) scale(0.95);
        text-shadow: 0 0 20px rgba(41, 151, 255, 0.2);
    }

    100% {
        transform: translateZ(0) scale(1.05);
        text-shadow:
            0 0 50px rgba(41, 151, 255, 0.9),
            0 0 100px rgba(41, 151, 255, 0.6);
    }
}

@keyframes lambda-navigation-shine {
    0% {
        background-position: 200% center;
    }

    100% {
        background-position: -200% center;
    }
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-pill);
    background: rgba(225, 225, 229, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(225, 225, 229, 0.2);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-medium);
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Metallic Shine on Hover for Default Button */
.btn:hover {
    background: rgba(225, 225, 229, 0.15);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 20px rgba(225, 225, 229, 0.3);
    /* Silver Glow */
    border-color: var(--color-platinum);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

/* Primary Button - Platinum / Electric Blue */
.btn-primary {
    background: linear-gradient(135deg, #e1e1e5, #c0c0c5);
    /* Metallic Gradient */
    color: #051025;
    /* Dark text for contrast */
    border: 1px solid #fff;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fff, #e1e1e5);
    box-shadow: 0 0 25px rgba(225, 225, 229, 0.6), 0 0 50px rgba(41, 151, 255, 0.2);
    /* Big shine */
    transform: translateY(-2px);
}


/* Navbar - Deep Blue Glass */
/* Navbar - Transparent Glass */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: var(--container-width);
    height: var(--header-height);
    background: rgba(225, 225, 229, 0.05);
    /* Match button glass exactly */
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* Keep glass edges */
    border-radius: var(--radius-pill);
    transition: all var(--transition-medium);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.navbar .container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
    color: var(--color-platinum);
    text-shadow: 0 0 15px rgba(225, 225, 229, 0.5);
    /* Glowing Text */
}

.brand-symbol {
    font-family: -apple-system, sans-serif;
    font-weight: 300;
    font-size: 1.5rem;
    color: var(--color-accent);
    /* Blue Lambda */
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* Specific styling for the Contact button inside Navbar - Portfolio CTA design */
.nav-links .btn {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 2rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-bg-primary) !important;
    text-decoration: none;
    letter-spacing: 0.03em;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(41, 151, 255, 0.2);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 0 20px rgba(41, 151, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
}

/* Animated Neon Border Effect */
.nav-links .btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        var(--color-accent) 25%,
        transparent 50%,
        transparent 50%,
        var(--color-accent) 75%,
        transparent 100%
    );
    z-index: -1;
    animation: rotate-gradient 3s linear infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Base background to mask the inner part of the gradient border */
.nav-links .btn::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: linear-gradient(135deg, #ffffff, #f0f0f5);
    border-radius: inherit;
    z-index: -1;
    transition: background 0.5s ease;
}

.nav-links .btn:hover {
    transform: translateY(-2px);
    color: var(--color-bg-primary) !important;
    border-color: transparent;
    box-shadow: 
        0 10px 25px rgba(255, 255, 255, 0.2),
        0 0 30px rgba(41, 151, 255, 0.3),
        inset 0 0 20px rgba(41, 151, 255, 0.1);
}

.nav-links .btn:hover::before {
    opacity: 1;
}

.nav-links .btn:hover::after {
    background: linear-gradient(135deg, #ffffff, #e1e1e5);
}

/* Navigation Brand & Region Selector */
.nav-brand-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Region switcher dropdown */
.region-switcher-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.region-switcher-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm, 4px);
    color: var(--color-text-secondary, #a0a5b5);
    font-family: var(--font-heading, inherit);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.region-switcher-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(41, 151, 255, 0.4);
    color: var(--color-platinum, #ffffff);
    box-shadow: 0 0 10px rgba(41, 151, 255, 0.15);
}

.region-switcher-trigger .region-arrow {
    font-size: 0.5rem;
    opacity: 0.7;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.region-switcher-dropdown.is-open .region-switcher-trigger .region-arrow {
    transform: rotate(180deg);
}

.region-switcher-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 8.5rem;
    padding: 0.4rem 0;
    background: rgba(8, 14, 28, 0.95);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm, 6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(41, 151, 255, 0.08);
    z-index: 1002;
    display: none;
}

.region-switcher-dropdown.is-open .region-switcher-menu {
    display: block;
}

.region-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary, #a0a5b5);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.region-item:hover {
    background: rgba(41, 151, 255, 0.1);
    color: #ffffff;
}

.region-item.active {
    color: var(--color-accent, #2997ff);
    font-weight: 700;
}

.region-indicator {
    font-size: 0.6rem;
    color: var(--color-accent, #2997ff);
}

/* Language switcher dropdown */
.lang-switcher-dropdown {
    position: relative;
    font-size: 0.85rem;
    font-weight: 500;
}

.lang-switcher-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm, 4px);
    color: var(--color-text-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
}

.lang-switcher-trigger:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
}

.lang-switcher-trigger .lang-arrow {
    font-size: 0.6rem;
    opacity: 0.8;
    transition: transform 0.2s;
}

.lang-switcher-dropdown.is-open .lang-switcher-trigger .lang-arrow {
    transform: rotate(180deg);
}

.lang-switcher-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 10rem;
    padding: 0.35rem 0;
    background: rgba(10, 20, 40, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm, 4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    display: none;
}

.lang-switcher-dropdown.is-open .lang-switcher-menu {
    display: block;
}

.lang-switcher-menu a,
.lang-switcher-menu .lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.lang-switcher-menu a:hover,
.lang-switcher-menu .lang-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
}

.flag-icon {
    width: 1.2em;
    height: auto;
    vertical-align: middle;
    display: inline-block;
}

/* Footer language switcher opens upwards */
.footer-lang-switcher .lang-switcher-menu {
    top: auto;
    bottom: calc(100% + 0.5rem);
    left: 0;
    right: auto;
}

.footer-brand-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: flex-start;
}

.footer-bottom-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Discreet footer service-area note */
.footer-service-note {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    opacity: 1;
    margin-top: 0.35rem;
    font-weight: 400;
}


.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-platinum);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.nav-link::after {
    display: none;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-platinum);
    background: transparent;
    border: 0;
    padding: 0.5rem;
    line-height: 1;
}

/* Hero Section */
.hero {
    min-height: 75vh; /* Permite asomar el carrusel inferior en escritorio */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: calc(var(--header-height) + 40px);
    overflow: hidden;
    /* Prevent any child (e.g. hero-symbol-bg) from creating horizontal scrollbar */
    max-width: 100%;
    contain: paint;
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 900px;
    padding: 0 1.5rem; /* Evita que el texto toque los bordes en pantallas pequeñas */
}

.hero-subtitle {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.8rem;
    margin-bottom: var(--space-md);
    color: var(--color-accent);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(41, 151, 255, 0.4);
}

.hero h1 {
    font-size: 4.2rem;
    margin-bottom: var(--space-md);
    /* Platinum Gradient Text */
    background: linear-gradient(to bottom right, #ffffff, #E1E1E5, #9095A5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(41, 151, 255, 0.2));
    /* Blue glow behind text */
}

.hero-title-suffix {
    display: block;
    font-size: 0.35em;
    font-weight: 400;
    color: var(--color-text-secondary);
    background: none;
    -webkit-text-fill-color: var(--color-text-secondary);
    opacity: 0.9;
    margin-top: 0.5rem;
    letter-spacing: normal;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: var(--space-md);
}

/* ── Animated Lambda (premium metallic text-reveal effect) ── */
.hero-symbol-bg {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 38vw;
    font-weight: 200; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1;
    color: transparent;
    
    /* Gradiente de metal pulido extendido por toda la figura */
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 1) 45%, /* Primer brillo especular */
        rgba(150, 170, 190, 0.3) 50%, /* Sombra profunda */
        rgba(255, 255, 255, 0.8) 75%, /* Segundo reflejo inferior */
        rgba(255, 255, 255, 0.5) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    
    z-index: 0;
    pointer-events: none;
    user-select: none;
    
    /* Static decorative state: it is visible on the first paint without
       extending Speed Index or competing with the hero copy. */
    opacity: 0.12;
    transform: translate(-50%, -50%);
}

/* Kept as a hook for older pages that still add this class. */
.hero-symbol-bg.lambda-animate {
    opacity: 0.12;
}

/* Cards (Metallic/Glass Panels) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-md);
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    transition: all var(--transition-medium);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Metallic Edge Reflection */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0), rgba(41, 151, 255, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    /* 'xor' in -webkit is usually 'exclude' in standard */
    pointer-events: none;
    opacity: 0.5;
}

.card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 10, 30, 0.4), 0 0 20px rgba(41, 151, 255, 0.1);
}

.card:hover::after {
    opacity: 1;
    /* Brighter edges on hover */
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--color-platinum);
}

.card p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-platinum);
    opacity: 0.85;
    margin: 0;
    position: relative;
    z-index: 1;
}

.card-number {
    position: absolute;
    top: -15px;
    right: 15px;
    font-size: 6rem;
    font-weight: 800;
    color: var(--color-platinum);
    opacity: 0.03;
    transition: all var(--transition-medium);
    z-index: 0;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: -3px;
}

.card:hover .card-number {
    opacity: 0.12;
    color: var(--color-blue);
    transform: translateY(5px);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-blue), transparent);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
    box-shadow: 0 0 15px var(--color-blue);
    opacity: 0;
    z-index: 2;
}

.card:hover .card-glow {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    /* Gold/Blue Icon Gradient */
    background: linear-gradient(135deg, #E1E1E5, #2997ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(41, 151, 255, 0.3));
}

/* Research Teaser Flex Layout */
.research-teaser-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

/* Section General */
section {
    padding: var(--space-xl) 0;
    position: relative;
}

/* Pulsars live in an absolutely-positioned paint layer behind the cards. */
.services {
    position: relative;
    isolation: isolate;
}

.services .container,
.services .card-grid,
.services > .section-header {
    position: relative;
    z-index: 1;
}

.services-pulsar-layer {
    --service-wave-size: clamp(170px, 20vw, 280px);
    --service-wave-end-scale: 3.6;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.services-pulsar-layer.is-positioning {
    opacity: 0;
    visibility: hidden;
    transition: none;
}

.services-pulsar-layer.is-positioned {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.service-pulsar-origin {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(0, 0, 0);
}

.services-pulsar-layer.is-positioned .service-pulsar-origin {
    opacity: 1;
}

.service-pulsar {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--service-wave-size);
    height: var(--service-wave-size);
    border: 1px solid rgba(41, 151, 255, 0.58);
    border-radius: 50%;
    box-shadow: 0 0 24px rgba(41, 151, 255, 0.32), inset 0 0 20px rgba(41, 151, 255, 0.12);
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.9);
    animation: servicePulsarWave 8s ease-out var(--service-pulse-delay, 0s) infinite;
    animation-play-state: paused;
}

.services.pulsars-active .service-pulsar {
    animation-play-state: running;
    will-change: transform, opacity;
}

@keyframes servicePulsarWave {
    0% {
        opacity: 0;
        transform: translate3d(-50%, -50%, 0) scale(0.9);
    }

    12% {
        opacity: 0.08;
    }

    30% {
        opacity: 0.46;
    }

    72% {
        opacity: 0.14;
    }

    100% {
        opacity: 0;
        transform: translate3d(-50%, -50%, 0) scale(var(--service-wave-end-scale));
    }
}

.services .card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 250px; /* Para asegurar que haya espacio vertical */
    cursor: pointer;
}

.services .card .card-details {
    display: none; /* Hide from card view, will be injected into modal via JS */
}

/* Interactivity Glow Effect (Safe from fade-in overrides) */
.services .card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    animation: interactiveCardGlow 8s infinite ease-in-out;
    border: 1px solid rgba(41, 151, 255, 0.4);
    box-shadow: 0 0 45px rgba(41, 151, 255, 0.5), inset 0 0 25px rgba(41, 151, 255, 0.2);
    opacity: 0;
}

/* Calm, elegant heartbeat peaking at 30% to sync perfectly with a slow wave */
@keyframes interactiveCardGlow {
    0%, 100% { 
        opacity: 0;
        transform: scale(1);
    }
    30% { 
        opacity: 1;
        transform: scale(1.01);
    }
}

@keyframes activeCardTopGlow {
    0%, 100% { transform: translateX(-50%) scaleX(0); opacity: 0; }
    30% { transform: translateX(-50%) scaleX(0.7); opacity: 1; }
}

@keyframes cardContentVibrate {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-1px); }
}

.services .card .card-summary {
    animation: cardContentVibrate 8s infinite ease-in-out;
    position: relative;
    z-index: 1;
}

.services .card .card-glow {
    width: 100%;
    transform-origin: center;
    animation: activeCardTopGlow 8s infinite ease-in-out;
}

.services .card:hover {
    transform: translateY(-5px) scale(1.02);
}

.services .card:hover::before {
    animation: none;
    box-shadow: 0 10px 40px rgba(41, 151, 255, 0.5), inset 0 0 25px rgba(41, 151, 255, 0.3);
    border-color: rgba(41, 151, 255, 0.7);
    transform: scale(1.015);
    opacity: 1;
}

.services .card:hover .card-summary,
.services .card:hover .card-glow {
    animation: none;
}

.services .card:hover .card-glow {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
}

/* Offset the pulses so they look organic and wave-like */
.card-grid .card:nth-child(2)::before, .card-grid .card:nth-child(2) .card-glow, .card-grid .card:nth-child(2) .card-summary { animation-delay: 2s; }
.card-grid .card:nth-child(3)::before, .card-grid .card:nth-child(3) .card-glow, .card-grid .card:nth-child(3) .card-summary { animation-delay: 4s; }
.card-grid .card:nth-child(4)::before, .card-grid .card:nth-child(4) .card-glow, .card-grid .card:nth-child(4) .card-summary { animation-delay: 6s; }

@media (max-width: 768px) {
    .services-pulsar-layer {
        --service-wave-size: 160px;
        --service-wave-end-scale: 2.9;
    }
}

@media (prefers-reduced-motion: reduce) {
    #elysium-preloader,
    #elysium-preloader .preloader-content {
        transition: none;
    }

    #elysium-preloader.is-leaving .preloader-lambda {
        animation: none;
        transform: none;
    }

    .services-pulsar-layer {
        display: none;
    }

    .services .card::before,
    .services .card .card-summary,
    .services .card .card-glow {
        animation: none;
    }
}

/* Premium Modal Native <dialog> */
.premium-service-modal {
    border: none;
    border-radius: var(--radius-lg);
    background: rgba(10, 10, 15, 0.85); /* Deep dark with glassmorphism */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    color: var(--color-text);
    padding: 0;
    max-width: 800px;
    width: 90%;
    margin: auto;
    overflow: visible; /* To allow close button to peek out if needed */
    
    /* Starting state for animation */
    opacity: 0;
    transform: scale(0.95) translateY(20px);
}

.premium-service-modal[open] {
    animation: modalFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.premium-service-modal.closing {
    animation: modalFadeOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.premium-service-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.premium-service-modal[open]::backdrop {
    opacity: 1;
}

.premium-service-modal.closing::backdrop {
    opacity: 0;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes modalFadeOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.95) translateY(20px); }
}

.premium-modal-content {
    padding: 3rem 4rem;
    position: relative;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.premium-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--color-platinum);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.premium-modal-close:hover {
    background: var(--color-blue);
    border-color: var(--color-blue);
    transform: rotate(90deg);
}

.premium-modal-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.premium-modal-body li {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    line-height: 1.8;
    padding-left: 1.5rem;
    border-left: 3px solid var(--color-blue);
    position: relative;
    animation: slideInLi 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateX(-15px);
}

.premium-modal-body li:nth-child(1) { animation-delay: 0.1s; }
.premium-modal-body li:nth-child(2) { animation-delay: 0.2s; }
.premium-modal-body li:nth-child(3) { animation-delay: 0.3s; }
.premium-modal-body li:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInLi {
    to { opacity: 1; transform: translateX(0); }
}

.premium-modal-body li:last-child {
    margin-bottom: 0;
}

.premium-modal-body li strong {
    color: var(--color-platinum);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
    letter-spacing: -0.5px;
}

/* Mobile adjustments for modal and cards */
@media (max-width: 768px) {
    .premium-modal-content {
        padding: 3rem 1.5rem 2.5rem 1.5rem; /* added top padding so text avoids close button */
    }
    
    .premium-modal-close {
        top: 0.75rem; /* move it up */
        right: 0.75rem; /* move it right */
        width: 32px; /* slightly smaller on mobile */
        height: 32px;
        font-size: 1.25rem;
    }
    
    .premium-modal-body li {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .premium-modal-body li strong {
        font-size: 1.05rem;
    }
    
    .services .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .services .card {
        min-height: 120px;
        padding: 1.5rem 1rem;
    }
    
    .card-number {
        font-size: 3rem;
        top: 2px;
        right: 8px;
    }
    
    .services .card .card-summary {
        font-size: 0.85rem;
    }
}

@media (min-width: 1024px) {
    .services .card-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    .services .card {
        padding: 2rem;
    }
}

/* Reduce gap after inner page header */
.page-header+section {
    padding-top: var(--space-md);
}

/* Currency Switcher Container */
.currency-switcher-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    margin-top: -3rem;
    /* pull up slightly closer to the header */
    position: relative;
    z-index: 10;
}

.currency-toggle {
    display: flex;
    gap: 0.5rem;
    background: rgba(225, 225, 229, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.4rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.currency-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.currency-btn:hover {
    color: var(--color-platinum);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.currency-btn.active {
    background: linear-gradient(135deg, rgba(41, 151, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: var(--color-platinum);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(41, 151, 255, 0.2);
}

.currency-flag {
    font-size: 1.1rem;
}

.section-header {
    margin-bottom: var(--space-lg);
    text-align: center;
    border-left: none;
    padding-left: 0;
}

.section-brands {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(41, 151, 255, 0.03) 50%, rgba(0, 0, 0, 0));
}

/* Tools Carousel - Infinite Scroll */
.logos {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: 1rem 0;
    /* Fade Masks for edges */
    -webkit-mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
    mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
    -webkit-mask-composite: source-in;
    /* Fix for Safari */
    mask-composite: intersect;
}

.logos:hover .logos-slide,
.logos.is-interacting .logos-slide {
    animation-play-state: paused;
}

.logos-slide {
    display: inline-flex;
    /* Use flex to control spacing perfectly */
    align-items: flex-start;
    will-change: transform;
    padding-right: 2rem;
    /* Buffer for seamless loop */
}

.logos-slide span,
.logos-slide .logo-item {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
    cursor: default;
    transition: all var(--transition-fast);
}

/* Logo item container with vertical layout */
.logos-slide .logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.85rem;
    width: 250px;
    /* Highly spacious fixed width to prevent any clashing */
    margin: 0;
    /* Gap handled by parent if preferred, or just rely on width */
    flex-shrink: 0;
}

/* Specific styles for logo images - small uniform rounded squares */
.logos-slide .logo-item img {
    height: 64px;
    width: 64px;
    object-fit: contain;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    display: block;
    filter: brightness(0.9) grayscale(0.2);
    transition: all var(--transition-fast);
}

.logos-slide .logo-item:hover img {
    filter: brightness(1) grayscale(0);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* Logo text label */
.logos-slide .logo-item span {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-secondary);
    margin: 0;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.logos-slide span:hover,
.logos-slide .logo-item:hover {
    color: var(--color-platinum);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.logos-slide .logo-item:hover img {
    filter: brightness(1) grayscale(0);
    /* Full color and brightness on hover */
    transform: scale(1.1);
}

.logos-slide .logo-item:hover span {
    color: var(--color-platinum);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

@keyframes slide {
    from {
        transform: translateX(0);
    }

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

/* ==========================================================================
   Portfolio iOS / VisionOS Floating Capsule
   ========================================================================== */
.ios-filter-container {
    display: flex;
    justify-content: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 100;
}

.ios-filter-capsule {
    display: flex;
    align-items: center;
    background: rgba(20, 20, 25, 0.45);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-search-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    margin-right: 8px;
    cursor: pointer;
}

.ios-icon {
    width: 20px;
    height: 20px;
    fill: rgba(255, 255, 255, 0.6);
    margin-left: 14px;
    margin-right: 8px;
    transition: fill 0.3s ease;
}

.ios-search-wrapper:hover .ios-icon,
.ios-search-wrapper.expanded .ios-icon {
    fill: rgba(255, 255, 255, 0.9);
}

.ios-search-input {
    width: 0;
    opacity: 0;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-search-input:focus,
.ios-search-input:not(:placeholder-shown),
.ios-search-wrapper.expanded .ios-search-input {
    width: 160px;
    opacity: 1;
    padding-right: 14px;
    outline: none;
}

.ios-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Vertical divider */
.ios-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 8px;
}

/* Segmented Control */
.ios-segmented-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ios-segment-slider {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    pointer-events: none;
}

.ios-segment {
    position: relative;
    z-index: 2;
    background: transparent;
    border: none;
    padding: 8px 18px;
    border-radius: 40px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.ios-segment:hover {
    color: rgba(255, 255, 255, 0.9);
}

.ios-segment.active {
    color: #fff;
    font-weight: 600;
}

.project-card.hidden {
    opacity: 0 !important;
    transform: scale(0.95) translateY(10px) !important;
    pointer-events: none;
}

/* Portfolio / Project Cards */
.project-grid-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-medium);
    position: relative;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--glass-border-highlight);
}

.project-image-wrapper {
    position: relative;
    height: 250px;
    overflow: hidden;
}

/* 
   Since we don't have images yet, we use a gradient placeholder.
   In a real scenario, this would apply to an <img> tag or background-image.
*/
.project-image {
    width: 100%;
    height: 100%;
    transition: transform var(--transition-bounce);
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 4, 16, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-medium);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay span {
    color: var(--color-platinum);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    padding: 1rem 2rem;
    border: 1px solid var(--color-platinum);
    border-radius: var(--radius-pill);
    transform: translateY(20px);
    transition: transform var(--transition-medium);
}

.project-card:hover .project-overlay span {
    transform: translateY(0);
}

.project-info {
    padding: 2rem;
}

.project-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.project-location {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.project-info p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-tags span,
.project-tags button,
.project-tags a {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-pill);
    color: var(--color-platinum);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: default;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    font-family: inherit;
}

.project-tags button {
    cursor: pointer;
}

.project-tags button:hover,
.project-tags a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Browser Mockup for Portfolio Previews */
.browser-mockup {
    position: relative;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    height: 100%;
    background: #1a1a1a;
}


.browser-mockup iframe {
    width: 400%;
    height: 400%;
    border: none;
    pointer-events: none;
    /* Prevent iframe interaction to allow link click */
    transform: scale(0.25);
    transform-origin: top left;
    background: white;
}

/* Mobile fallback: hide iframes (crash risk on iOS), show screenshot images */
.browser-mockup .mobile-preview {
    display: none;
}

@media (max-width: 768px) {
    .browser-mockup iframe {
        display: none;
    }

    .browser-mockup .mobile-preview {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top;
        border-radius: 0;
    }

    /* Page Header & Ethos */
    .page-header {
        min-height: 35vh;
    }

    .page-header h1 {
        font-size: 2.2rem !important;
        line-height: 1.2;
    }

    .intro-text {
        font-size: 1.2rem !important;
        line-height: 1.5 !important;
        margin-bottom: 2.5rem !important;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .parallax-lambda {
        font-size: 80vw;
        top: 50%;
    }

    .page-header .parallax-lambda {
        font-size: 45vw;
    }

    .read-more-btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Removed preview loading indicator styling */
/* Footer */
footer {
    background: rgba(2, 4, 16, 0.8);
    /* Darkest Blue */
    backdrop-filter: blur(20px);
    padding: var(--space-xl) 0 var(--space-lg);
    border-top: 1px solid var(--glass-border);
    margin-top: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

@media (max-width: 1100px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-grid .footer-col {
        align-items: center;
    }

    .footer-grid .footer-col:nth-child(2),
    .footer-bottom span:nth-child(2),
    .footer-lambda {
        display: none !important;
    }

    .footer-brand-wrapper {
        justify-content: center;
    }

    .footer-bottom-left {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        align-items: center;
    }
}

.footer-col h3,
.footer-col h4 {
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-platinum);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.footer-bottom {
    border-top: 1px solid var(--glass-border);
    padding-top: var(--space-md);
    display: flex;
    justify-content: space-between;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.animate-on-scroll {
    opacity: 1;
    transform: none;
}

.animate-on-scroll.reveal-pending {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* Testimonials Carousel */
.testimonial-carousel {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    padding: 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.testimonial-content {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.testimonial-quote {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-style: italic;
    line-height: 1.4;
    margin-bottom: 2rem;
    color: var(--color-text-primary);
}

.testimonial-author {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
}

.testimonial-indicators {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2rem;
}

.indicator {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--color-accent);
    box-shadow: 0 0 10px rgba(41, 151, 255, 0.5);
}

/* --- Parallax & Reveal Effects --- */

/* Layers of Wisdom - Header Lambda */
.page-header {
    position: relative;
    overflow: hidden;
}

.page-header {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--header-height);
    /* Ensure it starts below the navbar */
}

.page-header .container {
    position: relative;
    z-index: 1;
}

/* Keep the Services title visually connected to its introductory content. */
.services-page-header {
    min-height: clamp(330px, 40vh, 400px);
}

.services-page-header + .section {
    padding-top: 0;
}

.services-page-header + .section > .container > .animate-on-scroll:first-child {
    padding-top: 0 !important;
}

.services-page-header + .section .intro-panel-wrapper {
    padding-top: clamp(1.5rem, 3vw, 2rem);
}

.parallax-lambda {
    position: absolute;
    top: calc(50% + calc(var(--header-height) / 2));
    /* Centers perfectly in the space below the navbar */
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50vw;
    font-family: -apple-system, sans-serif;
    font-weight: 100;
    color: transparent;
    background: linear-gradient(135deg, rgba(41, 151, 255, 0.05), rgba(212, 175, 55, 0.03), transparent);
    -webkit-background-clip: text;
    background-clip: text;
    pointer-events: none;
    z-index: -1;
    user-select: none;
    line-height: 1;
    will-change: transform;
}

.page-header .parallax-lambda {
    font-size: 25vw;
    font-weight: 200;
    /* Doubled weight for better visibility */
}

/* Elegant Reveal - Scroll Animations */
.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered reveals */
.reveal-item.delay-1 {
    transition-delay: 0.1s;
}

.reveal-item.delay-2 {
    transition-delay: 0.2s;
}

.reveal-item.delay-3 {
    transition-delay: 0.3s;
}

/* Glass Parallax - Card Background Layer */
.card-parallax {
    position: relative;
    overflow: hidden;
    background: transparent !important;
    /* Managed by pseudo-element */
    isolation: isolate;
}

.card-parallax::before {
    content: '';
    position: absolute;
    inset: -20px;
    /* Slightly larger to allow movement without edges showing */
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    z-index: -1;
    will-change: transform;
}

/* Testimonial Animations */
@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-50px);
        opacity: 0;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-out {
    animation: slideOut 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

.slide-in {
    animation: slideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}


/* Mobile Optimization - iPhone Pro Max & General Mobile */

@media (max-width: 1024px) {

    /* --- Base CSS Overrides --- */
    :root {
        --space-md: 1.5rem;
        --space-lg: 3rem;
        --space-xl: 5rem;
        --header-height: 60px;
        /* Slightly smaller header */
    }

    h1 {
        font-size: 2.8rem;
        /* Scale down from 4rem */
    }

    h2 {
        font-size: 2.2rem;
        /* Scale down from 3rem */
    }

    h3 {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 1.25rem;
        /* Reduce padding slightly */
    }

    /* --- Components CSS Overrides --- */

    /* Navbar - Mobile Menu */
    .navbar {
        width: 100%;
        top: 0;
        border-radius: 0;
        /* Glass effect similar to 'View Services' button */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(25px) saturate(160%);
        -webkit-backdrop-filter: blur(25px) saturate(160%);
        background: rgba(225, 225, 229, 0.05);
    }

    .navbar .container {
        padding: 0 1.5rem;
    }

    .nav-links {
        display: none;
        /* Hidden by default */
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        /* Glassy but darker for text readability */
        background: rgba(2, 4, 16, 0.85);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2.5rem;
        gap: 2rem;
        z-index: 999;
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease-out forwards;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Crystal Overlay Effect */
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(2, 4, 16, 0.4);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
        z-index: 998;
        /* Just below nav-links */
        pointer-events: none;
    }

    body.mobile-menu-open::after {
        opacity: 1;
        visibility: visible;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        pointer-events: auto;
    }

    /* Soften the main content when menu is open */
    body.mobile-menu-open .page-content,
    body.mobile-menu-open footer,
    body.mobile-menu-open .hero {
        filter: blur(2px);
        transition: filter 0.4s ease;
    }

    .mobile-toggle {
        display: block;
        /* Show hamburger */
    }

    /* Adjust specific buttons in nav for mobile */
    .nav-links .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Hero Section */
    .hero {
        padding-top: calc(var(--header-height) + 120px);
        min-height: 60vh; /* Reduced height to pull tools section up */
        min-height: 60dvh;
        padding-bottom: 2rem; /* Reduced padding to bring sections closer */
        text-align: center;
    }

    /* Fix iOS Safari background-attachment: fixed rendering bug and parallax overflow */
    body {
        background-attachment: scroll;
    }

    .parallax-lambda {
        display: block;
        font-size: 80vw;
        opacity: 0.8;
    }

    .hero h1 {
        font-size: 3rem;
        line-height: 1.1;
    }

    .hero-symbol-bg {
        /* Removed width: 180vw — it was causing horizontal scroll on mobile */
        font-size: 85vw; /* Large λ on mobile without exceeding viewport width */
        top: 25%;
        left: 50%;
        transform: translateX(-50%);
        max-width: 100vw; /* Hard cap to prevent overflow */
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        /* Center the buttons */
        gap: 1.25rem;
        padding: 0 1rem;
    }

    .hero-cta .btn {
        width: auto;
        /* Fit to text instead of 100% */
        margin-right: 0 !important;
        padding: 0.8rem 3.5rem;
        /* Increased horizontal padding further by 40% */
        font-size: 0.9rem;
    }

    /* Cards & Grids */
    .card-grid,
    .project-grid-preview,
    .developers-grid,
    .footer-grid,
    .process-steps {
        grid-template-columns: 1fr;
        /* Stack everything */
    }

    .card {
        padding: 2rem;
    }

    /* Disable parallax-like scale on hover for mobile */
    .project-card:hover .project-image {
        transform: none !important;
    }

    .project-card:hover {
        transform: translateY(-5px);
        /* Reduced movement */
    }

    /* Tools Carousel */
    .logos-slide .logo-item {
        width: 160px;
        /* Smaller width for mobile items */
    }

    .logos-slide .logo-item img {
        height: 40px;
        width: 40px;
    }

    /* Research Teaser spacing fix */
    .research-teaser-flex {
        gap: 4rem;
        /* Increased spacing between research teaser elements on mobile */
    }

    /* Footer - mobile specifics already handled in 950px media query above */

    /* --- Pages CSS Overrides --- */

    /* Process Steps */
    .process-step {
        padding: 1.5rem;
    }

    .step-title {
        font-size: 1.25rem;
    }


    .step-number {
        font-size: 3rem;
        top: 10px;
        right: 15px;
    }

    /* Research List */
    .research-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .research-meta {
        align-self: flex-start;
    }

    /* Contact Form */
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

/* iPhone Pro Max Specific Tweaks (approx 430px width) */
@media (max-width: 430px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero h1 {
        font-size: 2.8rem;
    }
}

/* Accordion Grid */
.accordion-grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: 1fr;
    align-items: start;
}

@media (min-width: 768px) {
    .accordion-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .accordion-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .accordion-item:nth-child(1),
    .accordion-item:nth-child(2),
    .accordion-item:nth-child(3) {
        grid-column: span 2;
    }
    /* Center the bottom 2 items out of 5 */
    .accordion-item:nth-child(4) {
        grid-column: 2 / span 2;
    }
    .accordion-item:nth-child(5) {
        grid-column: 4 / span 2;
    }
}

.accordion-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-medium);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Metallic Edge Reflection */
.accordion-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0), rgba(41, 151, 255, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
}

.accordion-item:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 10, 30, 0.3), 0 0 15px rgba(41, 151, 255, 0.1);
}

.accordion-item:hover::after {
    opacity: 1;
}

.accordion-header {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 1.5rem 2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-platinum);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
}

.accordion-icon {
    font-size: 1.2rem;
    color: var(--color-accent);
    transition: transform var(--transition-medium);
}

.accordion-item.is-expanded .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-medium) cubic-bezier(0, 1, 0, 1);
    opacity: 0;
}

.accordion-item.is-expanded .accordion-content {
    max-height: 1000px;
    transition: max-height var(--transition-medium) ease-in-out;
    opacity: 1;
}

.accordion-body {
    padding: 0 2rem 2rem 2rem;
    color: var(--color-text-secondary);
}

.accordion-body ul {
    list-style: none;
    margin: 0 0 1.5rem 0;
    padding: 0;
}

.accordion-body li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.accordion-body li::before {
    content: '•';
    color: var(--color-accent);
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.accordion-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.accordion-note {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-style: italic;
    display: block;
}

/* --- Discrete Text Carousel --- */
.discrete-text-carousel {
    max-width: 800px;
    margin: 4rem auto 2rem;
    text-align: center;
    position: relative;
    height: 1.5rem;
    overflow: hidden;
}

.discrete-text-carousel.inline {
    display: inline-block;
    margin: 0;
    vertical-align: middle;
    text-align: left;
    height: 1.4em;
    width: 320px; /* Expanded to fit longer names like 'Países Angloparlantes' */
    overflow: hidden;
    position: relative;
    margin-left: 5px;
    top: -1px; /* Optical adjustment */
}

.discrete-text-carousel.inline .discrete-item {
    width: 100%;
    white-space: nowrap;
    opacity: 0;
    font-size: 1rem;
    color: var(--color-accent);
    transform: translateY(5px); /* Reduced movement */
    line-height: 1.4em;
}

.discrete-text-carousel.inline .discrete-item.active {
    opacity: 1;
    transform: translateY(0);
}

.discrete-text-carousel.inline .discrete-item.exit {
    opacity: 0;
    transform: translateY(-5px); /* Reduced movement */
}

.discrete-carousel-track {
    position: relative;
    height: 100%;
}

.discrete-item {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    opacity: 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(10px);
    font-style: italic;
    letter-spacing: 0.02em;
}

.discrete-item.active {
    opacity: 0.7;
    transform: translateY(0);
    z-index: 1;
}

.discrete-item.exit {
    opacity: 0;
    transform: translateY(-10px);
}

.discrete-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.discrete-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* --- Pro Packages --- */
.pro-packages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
    max-width: 1050px;
    margin-inline: auto;
}

@media (min-width: 900px) {
    .pro-packages-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.pro-package-card {
    background: var(--glass-bg);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.pro-package-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.pro-package-card h3 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 500;
}

.nested-package-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    height: 100%;
}

@media (min-width: 600px) {
    .nested-package-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.nested-package-col {
    display: flex;
    flex-direction: column;
}

.nested-package-col h4 {
    border-bottom: 1px solid var(--color-text-secondary);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.pro-package-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    flex-grow: 1;
}

.pro-package-list li {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: flex-start;
}

.pro-package-list li::before {
    content: '•';
    color: var(--color-text-secondary);
    margin-right: 0.8rem;
    font-weight: bold;
}

.pro-package-price-wrap {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pro-package-price {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.pro-package-subprice {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.pro-package-note {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* --- Intl Tel Input Overrides for Elysium Dark Theme --- */
.iti { 
    width: 100%; 
}
.iti__country-list {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    color: var(--color-text-primary);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    white-space: normal;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    max-height: 250px;
}
.iti__country {
    padding: 0.75rem 1.2rem;
    color: var(--color-text-secondary);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    display: flex !important;
    align-items: center;
}
.iti__country-list .iti__country:nth-child(2) {
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.25rem;
    padding-bottom: 1rem;
}
.iti__divider {
    border-bottom: 1px solid var(--glass-border) !important;
    margin: 0 0 0.25rem 0 !important;
    padding: 0 0 0.25rem 0 !important;
}
.iti__country.iti__highlight {
    background-color: var(--glass-bg-hover);
    color: var(--color-text-primary);
}
.iti__country-name {
    color: inherit;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1rem;
}
.iti__dial-code {
    color: rgba(225, 225, 229, 0.5);
}
.iti__arrow {
    border-top-color: var(--color-text-secondary);
}
.iti__arrow--up {
    border-top-color: transparent;
    border-bottom-color: var(--color-text-secondary);
}
.iti__selected-flag {
    padding: 0 1.2rem;
    background-color: transparent !important;
}
.iti__selected-flag:hover {
    background-color: transparent !important;
}
.iti__search-input {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--color-text-primary);
    border-radius: 8px;
    padding: 0.5rem;
    margin: 0.5rem;
    width: calc(100% - 1rem);
}
.iti__selected-dial-code {
    color: var(--color-text-primary);
    margin-left: 4px;
}
.iti__country-list::-webkit-scrollbar {
    width: 6px;
}
.iti__country-list::-webkit-scrollbar-track {
    background: transparent;
}
.iti__country-list::-webkit-scrollbar-thumb {
    background-color: var(--color-text-muted);
    border-radius: 10px;
}

/* --- Custom Success Modal --- */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(6, 11, 25, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}
.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.custom-modal {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--glass-shadow);
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-normal);
}
.custom-modal-overlay.active .custom-modal {
    transform: translateY(0) scale(1);
}
.custom-modal h3 {
    color: var(--color-text-primary);
}
.custom-modal p {
    color: var(--color-text-secondary);
}

/* Grayscale Logos Carousel */
.logos.logos-grayscale .logo-item img {
    filter: grayscale(1) brightness(1.5) opacity(0.7) !important;
    width: 130px !important;
    height: 50px !important;
    object-fit: contain !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.logos.logos-grayscale .logo-item:hover img {
    -webkit-filter: grayscale(0%) brightness(100%) opacity(100%) !important;
    filter: grayscale(0%) brightness(100%) opacity(100%) !important;
    transform: scale(1.1) !important;
    background: transparent !important;
}
.logos.logos-grayscale .logo-item {
    width: 180px !important;
}
