/* ==========================================================
   Nómada – portada (Principal/Inicio)
   Minimalista: líneas finas, sin tarjetas ni sombras.
   Tema claro por defecto; tema oscuro con <html class="oscuro"> (bloque al final).
   ========================================================== */

:root {
    --bg: #ffffff;
    --text: #0a0a0a;
    --muted: #6b6b6b;
    --line: #e7e7e7;
    --accent: #00a3c4;
    --on-text: #ffffff;                      /* texto sobre botones rellenos con --text */
    --nav-bg: rgba(255, 255, 255, .92);
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
/* Mientras se aplica el inglés al cargar (ver script del <head>) */
html.traduciendo body { visibility: hidden; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 16px/1.6 var(--sans);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.muted { color: var(--muted); }
.mono { font: 400 12.5px var(--mono); color: var(--muted); letter-spacing: .01em; }
.label {
    font: 500 12px var(--mono);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 24px;
}
.label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 10px; background: var(--accent); vertical-align: middle; }


/* ---------- Botones / enlaces ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 13px 24px;
    background: var(--text);
    color: var(--on-text);
    font: 500 15px/1 var(--sans);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity .2s;
}
.btn:hover { opacity: .82; }
.btn[disabled] { opacity: .5; cursor: wait; }
.link { font-weight: 500; border-bottom: 1px solid currentColor; padding-bottom: 1px; transition: color .2s; }
.link:hover { color: var(--accent); }

/* ---------- Navegación ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.nav--scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 32px; height: 68px; }
.nav__logo img { height: 40px; width: auto; }
.nav__menu { display: flex; align-items: center; gap: 30px; margin-left: auto; font-size: 14px; }
.nav__menu a { color: var(--muted); transition: color .2s; }
.nav__menu a:hover, .nav__menu .nav__cta { color: var(--text); }
.nav__cta { font-weight: 500; }
.nav__cta::after { content: " →"; }
.lang {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    color: var(--text);
    font: 500 12px var(--mono);
    cursor: pointer;
}
.lang:hover { border-color: var(--text); }
.nav__tools { display: flex; align-items: center; gap: 8px; }
/* Botón de tema: muestra el sol en modo oscuro (pasar a claro) y la luna en modo claro */
.theme { display: inline-grid; place-items: center; width: 32px; height: 28px; padding: 0; }
.theme svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme .ico-luna { fill: currentColor; stroke: none; }
.theme .ico-sol { display: none; }
html.oscuro .theme .ico-sol { display: block; }
html.oscuro .theme .ico-luna { display: none; }
.nav__toggle { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 120px 0 96px; overflow: hidden; }
.hero > .wrap { position: relative; z-index: 1; pointer-events: none; }
.hero > .wrap a, .hero > .wrap button { pointer-events: auto; }
/* Red de partículas sutil detrás del texto; se desvanece hacia la izquierda para no competir con el titular */
.hero__particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,.25) 0%, #000 45%);
    mask-image: linear-gradient(to right, rgba(0,0,0,.25) 0%, #000 45%);
}
.hero__particles.listo { opacity: 1; }
.hero__particles canvas { display: block; }
.hero h1 { max-width: 15ch; font-size: clamp(2.6rem, 6.4vw, 5rem); letter-spacing: -0.045em; line-height: 1.02; }
.hero__lead { max-width: 580px; margin-top: 32px; font-size: 19px; color: var(--muted); }
.hero__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 28px; margin-top: 40px; }

/* ---------- Clientes ---------- */
.clients { padding: 48px 0 24px; border-top: 1px solid var(--line); }
.clients__logos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 32px 40px; align-items: center; }
.clients__logos li { display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; }
.clients__logos img {
    width: auto;
    max-height: 30px;
    min-width: 0;
    object-fit: contain;
    filter: grayscale(1);
    opacity: .6;
    transition: filter .25s, opacity .25s;
}
.clients__logos img.alto { max-height: 46px; }
.clients__logos span { font-size: 13px; font-weight: 600; line-height: 1.15; color: var(--muted); transition: color .25s; }
.clients__logos li:hover img { filter: none; opacity: 1; }
.clients__logos li:hover span { color: var(--text); }

/* ---------- Secciones ---------- */
.section { padding: 120px 0; border-top: 1px solid var(--line); }
.section h2 { max-width: 20ch; font-size: clamp(2rem, 4vw, 3.1rem); }

/* Numerados */
.numbered { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 72px; }
.numbered li { padding-top: 24px; border-top: 1px solid var(--text); }
.num { display: block; font: 500 13px var(--mono); color: var(--accent); margin-bottom: 20px; }
.numbered h3 { font-size: 20px; margin-bottom: 12px; }
.numbered p { color: var(--muted); }

/* Capacidades (filas) */
.rows { margin-top: 64px; border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; padding: 28px 0; border-top: 1px solid var(--line); }
.row dt { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.row dd p { color: var(--muted); margin-bottom: 10px; max-width: 560px; }

/* Tabla comparativa */
.table-wrap { margin-top: 64px; overflow-x: auto; }
.compare { width: 100%; border-collapse: collapse; min-width: 560px; }
.compare th, .compare td { text-align: left; padding: 20px 24px 20px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom-color: var(--text); }
.compare thead th:last-child { color: var(--text); }
.compare tbody th { font-weight: 500; width: 28%; }
.compare tbody td { color: var(--muted); width: 36%; }
.compare tbody td:last-child { color: var(--text); }

/* Para firmas de IA */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.split .muted { margin-top: 24px; font-size: 18px; max-width: 460px; }
.checklist { border-bottom: 1px solid var(--line); margin-top: 8px; }
.checklist li { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.checklist li::before { content: "+"; font-family: var(--mono); color: var(--accent); }

/* Casos */
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 72px; }
.cases article { display: flex; flex-direction: column; padding-top: 24px; border-top: 1px solid var(--text); }
.cases__item--wide { grid-column: span 2; }
.cases__item--wide p { max-width: 640px; }
/* Cada logo trae un alto (--h) calculado para que todos ocupen un área visual similar */
.cases__logo { height: var(--h, 30px); width: auto; max-width: 180px; object-fit: contain; object-position: left; margin: calc((40px - var(--h, 30px)) / 2) 0 calc(28px + (40px - var(--h, 30px)) / 2); filter: grayscale(1); opacity: .85; }
.cases h3 { font-size: 20px; margin-bottom: 12px; }
.cases p { color: var(--muted); margin-bottom: 18px; }
.cases .mono { margin-top: auto; }

.calc-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    margin-top: 96px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}
.calc-link:hover .link { color: var(--accent); }
.calc-link .link { color: var(--text); white-space: nowrap; }

/* CTA final */
.cta { padding: 140px 0; }
.cta h2 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); max-width: 16ch; }
.cta .muted { margin-top: 24px; font-size: 19px; }

/* Panel del correo de ventas */
.mail-panel {
    max-width: 720px;
    margin-top: 40px;
    padding: 32px 0 8px;
    border-top: 1px solid var(--text);
    animation: panel-in .35s ease;
}
.mail-panel[hidden] { display: none; }
.mail-panel .label { margin-bottom: 14px; }
.mail-panel__address {
    font-size: clamp(1.5rem, 3.6vw, 2.4rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    word-break: break-all;
    user-select: all;
}
.mail-panel__address.resaltado { animation: resaltar 1.4s ease; }
.mail-panel__options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    color: var(--text);
    font: 500 14px var(--sans);
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
}
.chip:hover { border-color: var(--text); }
.chip.ok { background: var(--text); border-color: var(--text); color: var(--on-text); }
.mail-panel__status { min-height: 1.6em; margin-top: 12px; font-size: 14px; color: var(--muted); }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes resaltar {
    0% { background: rgba(0, 163, 196, .18); }
    100% { background: transparent; }
}

/* Footer */
.footer { padding: 40px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.footer__inner { display: flex; align-items: center; flex-wrap: wrap; gap: 20px 40px; }
.footer__logo { height: 30px; width: auto; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer__links a:hover { color: var(--text); }
.footer small { margin-left: auto; font-size: 13px; }

/* Aviso de cookies (partial compartido) */
#cookieConsent {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 100;
    max-width: 480px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    font-size: 14px;
}
#cookieConsent .row { display: flex; align-items: center; gap: 16px; padding: 0; border: 0; }
#cookieConsent .col { flex: 1; }
#cookieConsent a { text-decoration: underline; }
#cookieConsent button { padding: 8px 14px; border: 0; border-radius: 999px; background: var(--text); color: var(--on-text); font: 500 13px var(--sans); cursor: pointer; }
#cookieConsent.hidden { display: none; }

/* Aparición suave */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .nav__toggle {
        display: grid;
        gap: 6px;
        width: 36px;
        height: 36px;
        place-content: center;
        border: 0;
        background: none;
        cursor: pointer;
    }
    .nav__toggle span { display: block; width: 20px; height: 1.5px; background: var(--text); transition: transform .2s; }
    .menu-abierto .nav__toggle span:first-child { transform: translateY(3.75px) rotate(45deg); }
    .menu-abierto .nav__toggle span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
    .nav__tools { margin-left: auto; }
    .nav__menu {
        position: fixed;
        top: 68px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 32px 24px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        font-size: 17px;
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s, visibility .2s;
    }
    .nav__menu a { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text); }
    .menu-abierto .nav__menu { opacity: 1; visibility: visible; }

    .numbered, .cases { grid-template-columns: 1fr; gap: 40px; }
    .cases__item--wide { grid-column: auto; }
    .split { grid-template-columns: 1fr; gap: 40px; }
    .row { grid-template-columns: 1fr; gap: 10px; }
    .clients__logos { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
    .wrap { padding: 0 20px; }
    .nav__menu { padding: 8px 20px 24px; }
    .hero { padding: 72px 0 64px; }
    .section { padding: 80px 0; }
    .cta { padding: 96px 0; }
    .clients__logos { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .footer small { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================
   Tema oscuro: fondo azul noche (#050B14) y letras blancas
   Para volver al tema claro, quita class="oscuro" del <html> en Inicio.cshtml y Calculadora.cshtml.
   ========================================================== */
html.oscuro {
    /* Azul noche #050B14; textos y líneas en grises azulados del mismo tono */
    --bg: #050b14;
    --text: #f2f5f9;
    --muted: #97a3b6;
    --line: #1b2533;
    --accent: #22c3e0;
    --on-text: #050b14;
    --nav-bg: rgba(5, 11, 20, .86);
    color-scheme: dark;
}
/* Los logos de clientes son oscuros: en gris claro sobre negro.
   "lighten" hace que el fondo blanco de algunas imágenes (que al invertirse queda negro puro) no se vea como un recuadro. */
html.oscuro .clients__logos img,
html.oscuro .cases__logo { filter: grayscale(1) invert(1); opacity: .7; mix-blend-mode: lighten; }
/* Al pasar el mouse: el logo con sus colores originales sobre un recuadro blanco */
html.oscuro .clients__logos li { padding: 0 12px; border-radius: 10px; transition: background .25s; }
html.oscuro .clients__logos li:hover { background: #fff; }
html.oscuro .clients__logos li:hover img { filter: none; opacity: 1; mix-blend-mode: normal; }
html.oscuro .clients__logos li:hover span { color: #1e293b; }
/* Logo: a color en tema claro, blanco en tema oscuro */
.logo-oscuro { display: none; }
html.oscuro .logo-claro { display: none; }
html.oscuro .logo-oscuro { display: block; }

html.oscuro .mail-panel__address.resaltado { animation-name: resaltar-oscuro; }
@keyframes resaltar-oscuro { 0% { background: rgba(34, 195, 224, .25); } 100% { background: transparent; } }
