/* ==========================================================================
   Klovia Web Solutions — Rediseño 2026
   Paleta: base blanca + acento cian (tech) | Tipografía: Plus Jakarta Sans + Inter
   Nota: la sección CTA final usa cobalto oscuro como acento intencional de cierre.
   ========================================================================== */

/* ---------- Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- Design tokens ---------- */
:root {
    /* Color — tema claro */
    --bg-base: #FFFFFF;
    --bg-surface: #F8FAFC;
    --bg-surface-2: #EEF2F7;
    --bg-dark: #0F172A;

    --accent-cyan: #0E7490;              /* texto/íconos/bordes: legible sobre blanco */
    --accent-cyan-bright: #38BDF8;       /* decorativo: gradientes, glow, línea de proceso */
    --accent-cyan-deep: #06B6D4;
    --gradient-accent: linear-gradient(135deg, #38BDF8 0%, #06B6D4 100%);

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-on-accent: #062430;
    --text-on-dark: #F1F5F9;
    --text-on-dark-secondary: #94A3B8;

    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-subtle-dark: rgba(148, 163, 184, 0.16);
    --border-accent: rgba(14, 116, 144, 0.35);

    /* Layout */
    --radius: 14px;
    --radius-lg: 22px;
    --container-max: 1200px;
    --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.07);
    --shadow-glow: 0 14px 32px rgba(6, 182, 212, 0.18);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Type */
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

ul {
    list-style: none;
}

/* ---------- Shared: eyebrow / titles ---------- */
.eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}

.section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 3.5rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: var(--radius);
    padding: 0.85rem 1.6rem;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--text-on-accent);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.22);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(6, 182, 212, 0.32);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-ghost:hover {
    border-color: var(--border-accent);
    background: rgba(14, 116, 144, 0.05);
}

/* Botones sobre fondo oscuro (CTA final) */
.cta-final .btn-ghost {
    color: var(--text-on-dark);
    border-color: var(--border-subtle-dark);
}

.cta-final .btn-ghost:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.08);
}

.btn-sm {
    padding: 0.55rem 1.15rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* ---------- Navbar ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.1rem 0;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--border-subtle);
    padding: 0.8rem 0;
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 34px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.25rem;
}

.nav-link {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-cta-item {
    margin-left: 0.5rem;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Background texture (dot grid) ---------- */
.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(15, 23, 42, 0.09) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 40%, transparent 100%);
    pointer-events: none;
}

/* Variante clara para usar sobre fondo oscuro (CTA final) */
.cta-final .hero-bg-grid {
    background-image: radial-gradient(rgba(148, 163, 184, 0.18) 1px, transparent 1px);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 168px 0 120px;
    overflow: hidden;
    background: var(--bg-base);
}

.hero-k-watermark {
    position: absolute;
    top: 50%;
    right: -6%;
    width: 620px;
    max-width: 60vw;
    transform: translateY(-50%);
    opacity: 0.06;
    filter: brightness(0) saturate(100%) invert(70%) sepia(60%) saturate(1000%) hue-rotate(160deg);
    pointer-events: none;
}

.hero-container {
    position: relative;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
    align-items: center;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.1rem;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.01em;
    margin-bottom: 1.4rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin-bottom: 2.25rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
}

.hero-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.30) 0%, rgba(56, 189, 248, 0) 70%);
    filter: blur(10px);
    pointer-events: none;
}

.mockup {
    position: absolute;
    filter: drop-shadow(0 22px 38px rgba(15, 23, 42, 0.16));
    animation: float 6s ease-in-out infinite;
}

.mockup-ipad {
    width: 78%;
    max-width: 360px;
    z-index: 1;
}

.mockup-iphone {
    width: 46%;
    max-width: 210px;
    right: 6%;
    bottom: -6%;
    z-index: 2;
    animation-delay: -3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

/* ---------- Process ---------- */
.process {
    padding: 110px 0;
    background: var(--bg-base);
}

.process-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.process-track::before {
    content: '';
    position: absolute;
    top: 27px;
    left: calc(16.66% + 27px);
    right: calc(16.66% + 27px);
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan-bright), var(--accent-cyan-deep), var(--accent-cyan-bright));
    background-size: 200% 100%;
    opacity: 0.65;
    animation: flow 3.5s linear infinite;
}

@keyframes flow {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.process-step {
    position: relative;
    z-index: 1;
}

.step-number {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--accent-cyan);
    background: var(--bg-base);
    border: 1.5px solid var(--border-accent);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.step-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.step-description {
    color: var(--text-secondary);
    font-size: 0.98rem;
}

/* ---------- Services ---------- */
.services {
    padding: 110px 0;
    background: var(--bg-surface);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 2rem;
}

.service-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.service-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: rgba(14, 116, 144, 0.08);
    color: var(--accent-cyan);
    margin-bottom: 1.5rem;
}

.service-icon svg {
    width: 28px;
    height: 28px;
}

.service-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.service-list li {
    position: relative;
    padding-left: 1.6rem;
    color: var(--text-secondary);
    font-size: 0.98rem;
}

.service-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--gradient-accent);
    transform: rotate(45deg);
}

/* ---------- Portfolio ---------- */
.portfolio {
    padding: 110px 0;
    background: var(--bg-base);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.portfolio-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden; /* Esto es vital: recorta la imagen para que respete las esquinas redondeadas de la tarjeta */
    transition: var(--transition);
    display: flex;
    flex-direction: column; /* Ayuda a estructurar la tarjeta para que la imagen quede arriba y el texto abajo */
}

.portfolio-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

/* Modificaciones principales para eliminar márgenes */
.portfolio-image {
    width: 100%;
    height: 260px; /* Cambiamos min-height por height para tener un tamaño consistente */
    overflow: hidden;
    position: relative;
    /* Eliminamos el background, el padding y las propiedades flex que centraban la imagen */
}

.portfolio-image img {
    width: 100%;
    height: 100%; /* Obliga a la imagen a llenar todo el alto del contenedor */
    object-fit: cover; /* Recorta suavemente la imagen para que rellene el espacio sin aplastarse ni estirarse */
    display: block;
    /* Eliminamos max-width: 260px para permitir que toque los bordes */
}

/* --- De aquí en adelante tu código sigue intacto --- */

.portfolio-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    padding: 1.5rem 1.75rem 0.4rem;
}

.portfolio-description {
    color: var(--text-secondary);
    font-size: 0.92rem;
    padding: 0 1.75rem 1.75rem;
}

.portfolio-card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    background: transparent;
    border: 1.5px dashed var(--border-subtle);
}

.portfolio-cta-content {
    text-align: center;
    padding: 2.5rem 1.75rem;
}

.portfolio-cta-content .portfolio-title,
.portfolio-cta-content .portfolio-description {
    padding-left: 0;
    padding-right: 0;
}

.portfolio-cta-content .btn {
    margin-top: 1rem;
}

/* ---------- CTA final (acento oscuro intencional) ---------- */
.cta-final {
    position: relative;
    padding: 110px 0;
    text-align: center;
    background: var(--bg-dark);
    color: var(--text-on-dark);
    overflow: hidden;
}

.cta-final-content {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.cta-final-title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-on-dark);
}

.cta-final-subtitle {
    color: var(--text-on-dark-secondary);
    font-size: 1.1rem;
    margin-bottom: 2.25rem;
}

/* ---------- Footer ---------- */
.footer {
    padding: 60px 0 32px;
    background: var(--bg-base);
    border-top: 1px solid var(--border-subtle);
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    padding-bottom: 2.5rem;
}

.footer-logo {
    height: 32px;
    width: auto;
}

.footer-links {
    display: flex;
    gap: 1.75rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.92rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    color: var(--accent-cyan);
    border-color: var(--border-accent);
}

.social-link svg {
    width: 17px;
    height: 17px;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-legal {
    opacity: 0.75;
    font-size: 0.8rem;
}

/* ---------- Scroll-reveal (JS-controlled) ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ---------- Focus states ---------- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 3px;
    border-radius: 4px;
}

.cta-final a:focus-visible {
    outline-color: var(--accent-cyan-bright);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        order: 1;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        order: 0;
        min-height: 320px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 80%);
        height: 100vh;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 2rem;
        padding: 2rem;
        background: var(--bg-base);
        border-left: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-soft);
        transition: right 0.35s ease;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-cta-item {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .section-title {
        font-size: 1.85rem;
    }

    .process-track {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .process-track::before {
        top: 0;
        bottom: 0;
        left: 27px;
        right: auto;
        width: 2px;
        height: auto;
        background: linear-gradient(180deg, var(--accent-cyan-bright), var(--accent-cyan-deep), var(--accent-cyan-bright));
        background-size: 100% 200%;
        animation: flow-vertical 3.5s linear infinite;
    }

    @keyframes flow-vertical {
        0% { background-position: 0 0%; }
        100% { background-position: 0 200%; }
    }

    .process-step, 
    .process-card, 
    .process-content {
        padding-left: 60px; /* Ajusta este valor si necesitas más o menos espacio */
    }
    /* -------------------------------------------------- */

    .hero {
        padding: 140px 0 80px;
    }

    .hero-k-watermark {
        width: 380px;
        opacity: 0.05;
    }

    .cta-final-title {
        font-size: 1.9rem;
    }

    .footer-top {
        flex-direction: column;
        align-items: flex-start;
    }
}


@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .btn-lg {
        padding: 0.9rem 1.5rem;
        font-size: 0.92rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}