/* =====================================================================
   DataPixel — hoja de estilos consolidada (reemplaza a styles/footer/
   mobile/alignment-fix/services-fix/general-fixes/clients).
   Paleta única derivada del logo: azul · teal · naranja · azul profundo.
   ===================================================================== */

:root {
    /* Marca */
    --blue:    #1CA5E0;
    --blue-d:  #1789bd;
    --deep:    #164E74;
    --deep-2:  #10405f;
    --teal:    #1FB89A;
    --orange:  #F0562A;
    --orange-d:#d8451c;

    /* Neutros (sesgo azul, elegidos) */
    --ink:     #0E1B2A;
    --slate:   #5B6B7B;
    --surface: #EEF3F8;
    --surface-2:#E3ECF4;
    --card:    #FFFFFF;
    --line:    #DCE6EF;

    --bg:  #FFFFFF;
    --fg:  var(--ink);
    --muted: var(--slate);
    --nav-bg: rgba(255,255,255,.86);

    --shadow-sm: 0 1px 2px rgba(14,27,42,.06), 0 4px 12px rgba(14,27,42,.05);
    --shadow-md: 0 8px 30px rgba(14,27,42,.10);

    --maxw: 1160px;
    --radius: 14px;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
}

/* --------------------------- Tema oscuro --------------------------- */
/* Tokens redefinidos (los componentes usan siempre las variables).
   1) preferencia del sistema  2) override manual con data-theme. */
@media (prefers-color-scheme: dark) {
    :root {
        --deep:    #123C58;
        --deep-2:  #0d3149;
        --ink:     #E8EEF4;
        --slate:   #98A6B4;
        --surface: #121E2B;
        --surface-2:#16283a;
        --card:    #142331;
        --line:    #24384a;
        --bg:      #0B141E;
        --nav-bg:  rgba(11,20,30,.86);
        --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.35);
        --shadow-md: 0 10px 34px rgba(0,0,0,.5);
    }
}
:root[data-theme="light"] {
    --deep:#164E74; --deep-2:#10405f;
    --ink:#0E1B2A; --slate:#5B6B7B; --surface:#EEF3F8; --surface-2:#E3ECF4;
    --card:#FFFFFF; --line:#DCE6EF; --bg:#FFFFFF; --nav-bg:rgba(255,255,255,.86);
    --shadow-sm: 0 1px 2px rgba(14,27,42,.06), 0 4px 12px rgba(14,27,42,.05);
    --shadow-md: 0 8px 30px rgba(14,27,42,.10);
}
:root[data-theme="dark"] {
    --deep:#123C58; --deep-2:#0d3149;
    --ink:#E8EEF4; --slate:#98A6B4; --surface:#121E2B; --surface-2:#16283a;
    --card:#142331; --line:#24384a; --bg:#0B141E; --nav-bg:rgba(11,20,30,.86);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.35);
    --shadow-md: 0 10px 34px rgba(0,0,0,.5);
}

/* ------------------------------ Reset ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------- Utilidades --------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
    font-size: .78rem; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: var(--blue); margin-bottom: .8rem;
}
h1, h2, h3 { text-wrap: balance; line-height: 1.12; letter-spacing: -.02em; }

/* ------------------------------- Nav ------------------------------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; }
.brand-logo { height: 34px; width: auto; filter: none; }
/* Logo siempre a color, sin placa de fondo en ningún tema. */
.brand { border-radius: 9px; }

/* Botón de cambio de tema */
.theme-btn {
    border: 1px solid var(--line); background: var(--card); color: var(--fg);
    width: 38px; height: 38px; border-radius: 9px; cursor: pointer; font-size: 1rem;
    line-height: 1; display: grid; place-items: center; transition: border-color .2s; flex: none;
}
.theme-btn:hover { border-color: var(--blue); }
.nav-links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav-links > a { font-size: .92rem; font-weight: 600; color: var(--muted); transition: color .2s; }
.nav-links > a:hover { color: var(--fg); }
.nav-cta {
    background: var(--orange); color: #fff; padding: .55rem 1.1rem; border-radius: 9px;
    font-weight: 700; font-size: .9rem; transition: background .2s, transform .2s;
}
.nav-cta:hover { background: var(--orange-d); transform: translateY(-1px); }
.nav-cta--mobile { display: none; }
.nav-toggle {
    display: none; flex-direction: column; gap: 5px; width: 42px; height: 42px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--card);
    cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--fg); transition: transform .25s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----------------------------- Botones ----------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: .5rem; font-weight: 700;
    border-radius: 10px; padding: .85rem 1.4rem; font-size: .98rem; cursor: pointer;
    border: 1px solid transparent; transition: transform .2s, background .2s, border-color .2s, color .2s;
    font-family: inherit;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-d); transform: translateY(-2px); }
.btn-primary:disabled { opacity: .7; cursor: default; transform: none; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* ------------------------------ Hero ------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(60% 80% at 100% 0%, rgba(28,165,224,.16), transparent 60%),
        radial-gradient(50% 60% at 0% 100%, rgba(31,184,154,.12), transparent 55%);
}
.hero-grid {
    position: relative; display: grid; grid-template-columns: 1.15fr .85fr;
    gap: 56px; align-items: center; padding: 84px 0 90px;
}
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); font-weight: 800; }
.hero h1 .hl { color: var(--blue); }
.hero .lead { font-size: 1.18rem; color: var(--muted); max-width: 34ch; margin: 1.4rem 0 2.1rem; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 2.4rem; font-size: .86rem; color: var(--muted); }
.hero-meta b { color: var(--fg); }

.panel {
    position: relative; background: var(--card); border: 1px solid var(--line);
    border-radius: 18px; box-shadow: var(--shadow-md); padding: 22px; overflow: hidden;
}
.panel-bar { display: flex; gap: 6px; margin-bottom: 16px; }
.panel-bar i { width: 11px; height: 11px; border-radius: 50%; }
.panel-bar i:nth-child(1) { background: var(--orange); }
.panel-bar i:nth-child(2) { background: #f2b02e; }
.panel-bar i:nth-child(3) { background: var(--teal); }
.pixgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.pixgrid i { aspect-ratio: 1; border-radius: 6px; background: var(--surface-2); }
.pixgrid i.b { background: var(--blue); }
.pixgrid i.t { background: var(--teal); }
.pixgrid i.o { background: var(--orange); }
.pixgrid i.d { background: var(--deep); }
.panel-cap { margin-top: 16px; font-family: var(--mono); font-size: .8rem; color: var(--muted); }

/* ------------------------------ Stats ------------------------------ */
.stats { background: var(--deep); color: #eaf5fc; }
.stats-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 40px 0; text-align: center; }
.stats .num { font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
.stats .lbl { font-size: .85rem; color: #a9cfe4; margin-top: .2rem; }

/* --------------------------- Secciones ----------------------------- */
.block { padding: 84px 0; }
.block.alt { background: var(--surface); }
.sec-head { max-width: 640px; margin-bottom: 48px; }
.sec-head--center { max-width: none; text-align: center; }
.sec-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 800; }
.sec-head p { color: var(--muted); font-size: 1.05rem; margin-top: .9rem; }

/* ---------------------------- Servicios ---------------------------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px; box-shadow: var(--shadow-sm);
    transition: transform .22s, border-color .22s, box-shadow .22s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(28,165,224,.5); box-shadow: var(--shadow-md); }
.card .ico { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 16px; background: rgba(28,165,224,.12); color: var(--blue); font-size: 1.1rem; }
.card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .94rem; }
.card:nth-child(2) .ico { background: rgba(31,184,154,.14); color: var(--teal); }
.card:nth-child(3) .ico { background: rgba(240,86,42,.14); color: var(--orange); }
.card:nth-child(4) .ico { background: rgba(22,78,116,.16); color: var(--deep); }

/* ----------------------------- Nosotros ---------------------------- */
.why { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.why-title { font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 800; }
.why-list { list-style: none; margin-top: 8px; display: grid; gap: 20px; }
.why-list li { display: flex; gap: 14px; }
.why-list .chk { flex: none; width: 26px; height: 26px; border-radius: 7px; background: rgba(31,184,154,.16); color: var(--teal); display: grid; place-items: center; font-weight: 800; }
.why-list b { display: block; }
.why-list span { color: var(--muted); font-size: .95rem; }
.why-visual { background: linear-gradient(150deg, var(--deep), var(--deep-2)); border-radius: 18px; padding: 34px; color: #eaf5fc; box-shadow: var(--shadow-md); }
.why-visual .big { font-size: 3rem; font-weight: 800; color: #fff; }
.why-visual-sub { color: #a9cfe4; margin: .2rem 0 1.4rem; }
.why-visual .row { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.12); font-size: .95rem; }
.why-visual .row:last-child { border-bottom: 0; }
.why-visual .row b { color: #fff; }

/* ----------------------------- Proceso ----------------------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step .n { font-family: var(--mono); font-size: .9rem; font-weight: 700; color: var(--orange); letter-spacing: .05em; }
.step h3 { font-size: 1.08rem; font-weight: 700; margin: .5rem 0 .4rem; }
.step p { color: var(--muted); font-size: .92rem; }
.step::before { content: ""; display: block; height: 3px; width: 44px; background: var(--blue); border-radius: 3px; margin-bottom: 14px; }
.step:nth-child(2)::before { background: var(--teal); }
.step:nth-child(3)::before { background: var(--orange); }
.step:nth-child(4)::before { background: var(--deep); }

/* ----------------------------- Clientes ---------------------------- */
.client-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
    max-width: 1000px; margin: 0 auto;
}
.client-logo {
    display: grid; place-items: center; height: 90px; padding: 14px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--card);
    transition: border-color .2s, transform .2s, background .2s;
}
.client-logo:hover { transform: translateY(-3px); border-color: rgba(28,165,224,.4); background: #FFFFFF; }
.logo-gray {
    max-height: 56px; width: auto; object-fit: contain;
    filter: grayscale(100%); opacity: .55; transition: filter .35s, opacity .35s;
}
.client-logo:hover .logo-gray { filter: grayscale(0%); opacity: 1; }
.client-logo[hidden] { display: none; }

/* --------------------------- Testimonios --------------------------- */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.quote { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.quote .mark { color: var(--blue); font-size: 2.4rem; line-height: .4; font-weight: 800; }
.quote > p { font-size: .98rem; margin: .6rem 0 1.4rem; }
.quote .who { display: flex; align-items: center; gap: 12px; }
.quote .av { width: 38px; height: 38px; border-radius: 50%; background: rgba(31,184,154,.2); color: var(--deep); display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex: none; }
.quote .who b { display: block; font-size: .92rem; }
.quote .who > span > span { font-size: .82rem; color: var(--muted); }

/* ---------------------------- Contacto ----------------------------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 52px; }
.contact-info h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 800; }
.contact-lead { color: var(--muted); margin: .9rem 0 2rem; }
.cinfo { display: grid; gap: 16px; }
.cinfo .item { display: flex; gap: 12px; align-items: center; }
.cinfo .ci { width: 40px; height: 40px; border-radius: 10px; background: rgba(28,165,224,.12); color: var(--blue); display: grid; place-items: center; flex: none; }
.cinfo b { display: block; font-size: .95rem; }
.cinfo .item span { color: var(--muted); font-size: .9rem; }
form { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
    width: 100%; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 10px;
    background: var(--bg); color: var(--fg); font: inherit; font-size: .95rem; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28,165,224,.22); }
.field input.invalid, .field textarea.invalid { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,86,42,.18); }
.field textarea { min-height: 120px; resize: vertical; }
.form-error { color: var(--orange-d); font-size: .88rem; margin-bottom: 12px; font-weight: 600; }
.form-submit { width: 100%; justify-content: center; }

/* ------------------------------ Footer ----------------------------- */
.site { background: var(--deep); color: #cfe4f0; padding: 56px 0 28px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.foot-logo { height: 40px; width: auto; margin-bottom: 14px; filter: brightness(0) invert(1); }
.site p { color: #a9cfe4; font-size: .92rem; max-width: 30ch; }
.site h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: #7fb2cf; margin-bottom: 14px; }
.site ul { list-style: none; display: grid; gap: 10px; }
.site ul a { color: #cfe4f0; font-size: .92rem; transition: color .2s; }
.site ul a:hover { color: #fff; }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); font-size: .85rem; color: #8fb4cb; }

/* ------------------------- Reveal on scroll ------------------------ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ============================ Responsive =========================== */
@media (max-width: 900px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
    .hero-grid { grid-template-columns: 1fr; gap: 40px; padding: 60px 0 64px; }
    .panel { order: -1; margin-top: 28px; }
    .hero-meta { padding-bottom: 40px; }
    .why { grid-template-columns: 1fr; gap: 36px; }
    .contact-grid { grid-template-columns: 1fr; gap: 36px; }
    .quotes { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    /* Menú móvil */
    .nav-cta:not(.nav-cta--mobile) { display: none; }
    .nav-toggle { display: flex; }
    /* Empuja el tema + la hamburguesa al extremo derecho del header */
    .theme-btn { margin-left: auto; }
    .nav-links {
        position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch;
        gap: 0; margin: 0; background: var(--bg); border-bottom: 1px solid var(--line);
        padding: 8px 24px 20px; box-shadow: var(--shadow-md);
        transform: translateY(-140%); transition: transform .3s ease; visibility: hidden;
    }
    .nav-links.open { transform: translateY(0); visibility: visible; }
    .nav-links > a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
    .nav-cta--mobile { display: inline-flex; justify-content: center; margin-top: 14px; border: none; }
}
@media (max-width: 780px) {
    .steps { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
    .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 680px) {
    .stats-inner { grid-template-columns: repeat(2, 1fr); gap: 30px 12px; }
    .client-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
    .wrap { padding: 0 18px; }
    .block { padding: 60px 0; }
    .cards { grid-template-columns: 1fr; }
    .hero-meta { gap: 16px; }
}
@media (max-width: 460px) {
    .client-grid { grid-template-columns: repeat(2, 1fr); }
}
