*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --emerald: #10b981;
    --violet: #7c3aed;
    --charcoal: #18181b;
    --offwhite: #fafafa;
    --coral: #f97316;
    --light-emerald: rgba(16, 185, 129, 0.1);
    --light-violet: rgba(124, 58, 237, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--charcoal);
    background: var(--offwhite);
}

/* ─── HEADER ─── */
header {
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(247, 247, 247);
    backdrop-filter: blur(15px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.8rem 7%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    /* Evita que el nombre de la marca se desborde */
    min-width: 0;
}

/* Nombre de la marca — se trunca si no cabe */
.brand-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-logo {
    width: 145px;
    height: 145px;
    flex-shrink: 0;
    margin: -46px 0;
    border-radius: 20%;
    overflow: hidden;
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--emerald), var(--violet));
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.menu-nav {
    display: flex;
    gap: 3.5rem;
    list-style: none;
    flex-shrink: 0;
}

.menu-nav a {
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s;
}

.menu-nav a::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--emerald);
    border-radius: 50%;
    left: -15px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.3s;
}

.menu-nav a:hover {
    color: var(--emerald);
}

.menu-nav a:hover::before {
    transform: translateY(-50%) scale(1);
}

/* ─── HERO ─── */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, white 0%, #f8fafc 100%);
    display: flex;
    align-items: center;
    margin-top: 80px;
    position: relative;
}

.hero-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 7%;
    width: 100%;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 8rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 5.5rem;
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 2rem;
    color: var(--charcoal);
    letter-spacing: -2px;
}

.hero-text .gradient-word {
    background: linear-gradient(135deg, var(--emerald), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.hero-text p {
    font-size: 1.4rem;
    color: #71717a;
    margin-bottom: 3rem;
    line-height: 1.7;
    max-width: 550px;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

.btn-main {
    padding: 1.4rem 3.5rem;
    background: linear-gradient(135deg, var(--emerald), var(--violet));
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 60px;
    transition: all 0.3s;
    font-size: 1.05rem;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.btn-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
}

.btn-outline {
    padding: 1.4rem 3.5rem;
    background: transparent;
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 700;
    border: 2px solid var(--charcoal);
    border-radius: 60px;
    transition: all 0.3s;
    font-size: 1.05rem;
}

.btn-outline:hover {
    background: var(--charcoal);
    color: white;
    transform: translateY(-2px);
}

/* ─── VISUAL CARDS CON FLIP ─── */
.hero-visual {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Contenedor con perspectiva para efecto 3D */
.visual-card {
    aspect-ratio: 1;
    perspective: 800px;
    cursor: pointer;
    border-radius: 25px;
}

/* Elemento interior que rota */
.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 25px;
}

/* Al hacer click se voltea */
.visual-card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Cara frontal y trasera comparten estilos base */
.card-front,
.card-back {
    position: absolute;
    inset: 0;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Frente: fondo blanco con imagen */
.card-front {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), white);
    backdrop-filter: blur(20px);
}

/* Hover solo en frente (cuando no está volteado) */
.visual-card:not(.flipped):hover .card-front {
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

/* Reverso: gradiente con texto */
.card-back {
    background: linear-gradient(135deg, var(--emerald), var(--violet));
    transform: rotateY(180deg);
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.5rem;
    text-align: center;
}

.card-back h4 {
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
}

.card-back p {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Hint de "haz click" en la primera tarjeta */
.visual-card:first-child .card-front::after {
    
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--emerald);
    opacity: 0.6;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ─── SERVICIOS ─── */
.services {
    padding: 8rem 5%;
    background: white;
    position: relative;
    overflow: hidden;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, var(--light-emerald) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, var(--light-violet) 0%, transparent 50%);
    z-index: 0;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
    position: relative;
    z-index: 1;
}

.section-header h2 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--charcoal);
}

.section-header .gradient-text {
    background: linear-gradient(135deg, var(--emerald), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 1.3rem;
    color: #71717a;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.service-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 25px;
    padding: 3rem 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--light-emerald), var(--light-violet));
    opacity: 0;
    transition: opacity 0.4s;
    z-index: -1;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--emerald), var(--violet));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s;
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 70px rgba(16, 185, 129, 0.25),
                0 0 40px rgba(16, 185, 129, 0.15),
                0 0 60px rgba(124, 58, 237, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
}

.service-card:hover::before { opacity: 1; }
.service-card:hover::after { transform: scaleX(1); }

.service-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1.5rem;
    transition: transform 0.4s;
    filter: drop-shadow(0 0 0px transparent);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.4));
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--charcoal);
}

.service-card p {
    color: #71717a;
    line-height: 1.7;
    font-size: 1rem;
}

/* ─── TICKER ─── */
.clients-ticker {
    padding: 6rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, white 100%);
    overflow: hidden;
}

.ticker-title {
    text-align: center;
    margin-bottom: 4rem;
    padding: 0 7%;
}

.ticker-title h2 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--charcoal);
}

.ticker-title p {
    font-size: 1.2rem;
    color: #71717a;
}

.ticker-wrapper {
    display: flex;
    animation: scroll 30s linear infinite;
    gap: 4rem;
}

.ticker-item {
    font-size: 2rem;
    font-weight: 900;
    color: #e4e4e7;
    white-space: nowrap;
    letter-spacing: 3px;
    transition: color 0.3s;
}

.ticker-item:hover { color: var(--emerald); }

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ─── ABOUT ─── */
.about {
    padding: 8rem 5%;
    background: white;
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40%;
    height: 60%;
    background: radial-gradient(circle at center, var(--light-violet) 0%, transparent 70%);
    z-index: 0;
}

.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
    position: relative;
    z-index: 1;
}

.about-content h2 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 2rem;
    color: var(--charcoal);
}

.about-content p {
    font-size: 1.2rem;
    color: #71717a;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.highlight-box {
    background: linear-gradient(135deg, var(--light-emerald), var(--light-violet));
    border-left: 4px solid var(--emerald);
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.highlight-box h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--charcoal);
}

.highlight-box p {
    font-size: 1.1rem;
    margin: 0;
}

.about-visual {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    position: relative;
}

.floating-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s;
    animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(1) { animation-delay: 0s; }
.floating-card:nth-child(2) { animation-delay: 2s; }
.floating-card:nth-child(3) {
    animation-delay: 4s;
    grid-column: 1 / -1;
    max-width: 300px;
    margin: 0 auto;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.floating-card:hover {
    transform: translateY(-20px) scale(1.03);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation-play-state: paused;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--emerald), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    color: #71717a;
    font-weight: 600;
}

/* ─── CONTACTO ─── */
.contact-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1600px;
    margin: 0 auto;
    background: white;
}

.contact-left {
    background: linear-gradient(135deg, #1a1a1d 0%, var(--charcoal) 100%);
    color: white;
    padding: 8rem 7%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-left h2 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 2rem;
    line-height: 1.1;
}

.contact-left p {
    font-size: 1.3rem;
    margin-bottom: 4rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
}

.contact-detail {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    transition: transform 0.3s;
}

.contact-detail:hover { transform: translateX(5px); }

.contact-detail strong {
    color: var(--emerald);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-detail span { font-size: 1.2rem; }

.contact-detail a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-detail a:hover { color: var(--emerald); }

.contact-right {
    background: white;
    padding: 8rem 7%;
}

.form-wrap { max-width: 500px; }

.input-field { margin-bottom: 2rem; }

.input-field label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 700;
    color: var(--charcoal);
    font-size: 0.95rem;
}

.input-field input,
.input-field textarea {
    width: 100%;
    padding: 1.2rem;
    border: 2px solid #e4e4e7;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.input-field input:focus,
.input-field textarea:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.input-field textarea {
    min-height: 150px;
    resize: vertical;
}

.form-submit {
    width: 100%;
    padding: 1.4rem;
    background: linear-gradient(135deg, var(--emerald), var(--violet));
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.form-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
}

/* ─── SCROLL TOP ─── */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--emerald), var(--violet));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 10px 35px rgba(16, 185, 129, 0.5);
}

footer {
    padding: 3rem 7%;
    background: var(--charcoal);
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 968px) {
    /* Header: reducir logo y padding para que no tape el nombre */
    .header-wrap {
        padding: 0.8rem 4%;
    }

    .header-logo {
        width: 70px;
        height: 70px;
        margin: -10px 0;
    }

    .brand {
        font-size: 1rem;
        gap: 0.5rem;
    }

    .menu-nav { display: none; }

    /* Hero */
    .hero-wrap {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
    .hero-text h1 { font-size: 3.5rem; }
    .hero-section { margin-top: 60px; }

    /* Visual cards en 2 columnas en móvil */
    .hero-visual {
        grid-template-columns: repeat(2, 1fr);
    }

    /* About */
    .about-container { grid-template-columns: 1fr; }
    .about-visual { grid-template-columns: 1fr; }
    .about-visual .floating-card:nth-child(3) { grid-column: 1; }

    /* Contacto */
    .contact-split { grid-template-columns: 1fr; }

    /* Servicios */
    .services-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .header-logo {
        width: 50px;
        height: 50px;
        margin: -6px 0;
    }
    .brand {
        font-size: 0.85rem;
    }
    .hero-text h1 { font-size: 2.8rem; }
    .cta-group { flex-direction: column; }
    .btn-main, .btn-outline { text-align: center; }
}

/* ─── Clases legacy (no eliminadas por si acaso) ─── */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(0, 0, 0);
    font-weight: bold;
}