/* ==========================================================================
   FILESFARM — V2 "SALA DE CONTROL"
   Estética editorial-industrial: navy profundo, lima de marca, mono técnico.
   ========================================================================== */

:root {
    /* Paleta */
    --ink: #04080D;                 /* fondo base casi negro azulado */
    --ink-2: #070E17;               /* fondo alterno */
    --surface: #0A1420;             /* superficies / tarjetas */
    --surface-2: #0D1A29;           /* superficie elevada */
    --line: rgba(148, 170, 190, 0.14);
    --line-strong: rgba(148, 170, 190, 0.28);

    --accent: #8DCC33;              /* verde lima de marca */
    --accent-soft: rgba(141, 204, 51, 0.12);
    --accent-line: rgba(141, 204, 51, 0.35);
    --olive: #849966;               /* verde oliva institucional */

    --text: #E9EFF5;
    --text-dim: #93A3B4;
    --text-faint: #5C6C7E;

    /* Tipografía */
    --f-display: 'Space Grotesk', sans-serif;
    --f-serif: 'Instrument Serif', serif;
    --f-mono: 'IBM Plex Mono', monospace;
    --f-body: 'Inter', sans-serif;

    --container: 1240px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--f-body);
    background: var(--ink);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

::selection { background: var(--accent); color: var(--ink); }

h1, h2, h3, h4 {
    font-family: var(--f-display);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.mono {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.serif {
    font-family: var(--f-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0;
}

em.accent, .accent-txt { color: var(--accent); }
.muted { color: var(--text-dim); }

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

/* ---------- Grano global ---------- */
.grain {
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain-shift 8s steps(10) infinite;
}
@keyframes grain-shift {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-3%, 2%); }
    40% { transform: translate(2%, -3%); }
    60% { transform: translate(-2%, -2%); }
    80% { transform: translate(3%, 3%); }
}

/* ---------- Barra de progreso ---------- */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    z-index: 1001;
    box-shadow: 0 0 12px rgba(141, 204, 51, 0.7);
}

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: background 0.4s, border-color 0.4s;
}
.site-header.scrolled {
    background: rgba(4, 8, 13, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
}
.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 28px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand-logo { height: 40px; width: auto; }

.main-nav { display: flex; gap: 28px; }
.nav-link {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    position: relative;
    padding: 6px 0;
    white-space: nowrap;
    transition: color 0.25s;
}
.nav-link::before {
    content: attr(data-num) ' ';
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.25s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::before, .nav-link.active::before { opacity: 1; }

.header-right { display: flex; align-items: center; gap: 16px; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 10px 9px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 15px 30px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.btn-solid {
    background: var(--accent);
    color: #0A1400;
    box-shadow: 0 0 0 rgba(141, 204, 51, 0);
}
.btn-solid:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(141, 204, 51, 0.35);
}
.btn-ghost {
    border-color: var(--line-strong);
    color: var(--text);
    background: transparent;
}
.btn-ghost:hover {
    border-color: var(--accent-line);
    color: var(--accent);
    transform: translateY(-2px);
}
.btn-sm { padding: 10px 20px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
    position: relative;
    padding: 104px 0 52px;
    overflow: hidden;
}

/* Grilla técnica de fondo */
.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 75%);
    opacity: 0.55;
}
.hero-glow {
    position: absolute;
    width: 900px;
    height: 900px;
    top: -350px;
    right: -250px;
    background: radial-gradient(circle, rgba(141, 204, 51, 0.13) 0%, transparent 62%);
    filter: blur(10px);
    pointer-events: none;
}
.hero-layout {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 64px;
    align-items: center;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--accent);
    border: 1px solid var(--accent-line);
    padding: 8px 16px;
    border-radius: 2px;
    background: var(--accent-soft);
    margin-bottom: 22px;
}
.kicker-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

.hero-title {
    font-size: clamp(2.1rem, 3.8vw, 3.2rem);
    margin-bottom: 20px;
}
.hero-title .line { display: block; }
.hero-title .serif { font-size: 1.06em; }

.hero-sub {
    color: var(--text-dim);
    font-size: 1.05rem;
    max-width: 540px;
    margin-bottom: 26px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 38px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    width: fit-content;
}
.hero-stats dt { color: var(--text-faint); margin-bottom: 5px; }
.hero-stats dd {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1.7rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* --- Escáner: documento → datos estructurados --- */
.scanner-card {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8), 0 0 60px rgba(141, 204, 51, 0.05);
}
.scanner-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}
.t-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.t-dot:first-child { background: rgba(141, 204, 51, 0.6); }
.scanner-title { color: var(--text-faint); margin-left: 8px; flex: 1; }
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent);
}
.live-badge i {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: blink 1.2s infinite;
}

.scanner-stage {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 24px 24px;
    min-height: 264px;
}

/* Documento PDF */
.scan-doc {
    position: relative;
    width: 148px;
    height: 196px;
    background: #EDF2F7;
    border-radius: 6px;
    padding: 40px 16px 16px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.doc-fold {
    position: absolute;
    top: 0; right: 0;
    width: 26px; height: 26px;
    background: var(--surface);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.doc-fold::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #C4CEDA;
    clip-path: polygon(0 0, 0 100%, 100% 100%);
}
.doc-badge {
    position: absolute;
    top: 12px; left: 16px;
    background: #0A1E36;
    color: #fff;
    font-size: 0.58rem;
    padding: 3px 7px;
    border-radius: 2px;
}
.doc-name {
    position: absolute;
    bottom: 10px; left: 16px; right: 16px;
    color: #45566B;
    font-size: 0.56rem;
    letter-spacing: 0.04em;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-lines { display: grid; gap: 9px; }
.doc-lines i {
    display: block;
    height: 7px;
    border-radius: 2px;
    background: #C4CEDA;
}
.doc-lines i:nth-child(1) { width: 62%; background: #9FAEC0; }
.doc-lines i:nth-child(3) { width: 84%; }
.doc-lines i:nth-child(5) { width: 70%; }
.doc-lines i:nth-child(6) { width: 45%; }

/* Láser de escaneo */
.scan-laser {
    position: absolute;
    left: 0; right: 0;
    top: -12%;
    height: 3px;
    background: var(--accent);
    box-shadow: 0 0 18px 4px rgba(141, 204, 51, 0.65);
    opacity: 0;
}
.scan-doc.scanning .scan-laser {
    opacity: 1;
    animation: laser-sweep 1.5s ease-in-out;
}
@keyframes laser-sweep {
    0% { top: -4%; }
    100% { top: 102%; }
}
.scan-doc.scanning .doc-lines i { animation: line-read 1.5s ease-in-out; }
@keyframes line-read {
    40% { background: rgba(141, 204, 51, 0.75); }
}

/* Flecha IA */
.scan-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--accent);
}
.scan-arrow-line {
    width: 1px;
    height: 44px;
    background: linear-gradient(180deg, transparent, var(--accent-line), transparent);
    position: relative;
    overflow: hidden;
}
.scan-arrow-line::after {
    content: '';
    position: absolute;
    left: 0; top: -30px;
    width: 100%; height: 30px;
    background: linear-gradient(180deg, transparent, var(--accent));
    animation: arrow-flow 1.6s linear infinite;
}
@keyframes arrow-flow { to { top: 100%; } }

/* Campos extraídos */
.scan-fields { display: grid; gap: 12px; min-width: 0; }
.scan-field {
    border: 1px solid var(--line);
    background: var(--ink);
    border-radius: 5px;
    padding: 10px 15px;
    display: grid;
    gap: 3px;
    opacity: 0.45;
    transform: translateX(8px);
    transition: opacity 0.4s, transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.scan-field.filled { opacity: 1; transform: none; }
.scan-field > span { color: var(--text-faint); font-size: 0.6rem; }
.scan-field strong {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    min-height: 1.4em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scan-status.filled {
    border-color: var(--accent-line);
    box-shadow: 0 0 22px rgba(141, 204, 51, 0.14);
}
.scan-status strong { color: var(--accent); }

.scanner-foot {
    border-top: 1px solid var(--line);
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.scanner-foot-label { color: var(--text-faint); }
.t-meter { display: flex; align-items: center; gap: 14px; flex: 1; }
.t-meter strong { color: var(--accent); }
.t-meter-track {
    flex: 1;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}
.t-meter-fill {
    height: 100%;
    width: var(--w);
    background: linear-gradient(90deg, var(--olive), var(--accent));
    border-radius: 2px;
    animation: meter-in 1.8s var(--ease) both;
    box-shadow: 0 0 10px rgba(141, 204, 51, 0.5);
}
@keyframes meter-in { from { width: 0; } }

/* ==========================================================================
   MARQUEE
   ========================================================================== */
.marquee {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--ink-2);
    overflow: hidden;
    padding: 18px 0;
}
.marquee-track {
    display: flex;
    align-items: center;
    gap: 34px;
    width: max-content;
    animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-dim);
    white-space: nowrap;
}
.marquee-track i { color: var(--accent); font-style: normal; font-size: 0.8rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================================
   SECCIONES — BASE
   ========================================================================== */
.section { padding: 56px 0 96px; position: relative; }
.section-alt { background: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.sec-head {
    display: flex;
    gap: 34px;
    align-items: flex-start;
    margin-bottom: 70px;
}
.sec-num {
    font-size: 0.8rem;
    color: var(--accent);
    border: 1px solid var(--accent-line);
    padding: 8px 12px;
    border-radius: 2px;
    background: var(--accent-soft);
    flex-shrink: 0;
    margin-top: 8px;
}
.sec-label { color: var(--text-faint); margin-bottom: 14px; }
.sec-head-txt h2 {
    font-size: clamp(1.9rem, 3.6vw, 3rem);
    max-width: 780px;
}
.sec-head-txt .serif { font-size: 1.07em; }

.lead { font-size: 1.15rem; color: var(--text); line-height: 1.7; }

/* ==========================================================================
   01 · QUÉ ES
   ========================================================================== */
.que-es-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 70px;
    align-items: start;
}
.que-es-main p { color: var(--text-dim); margin-top: 22px; }
.que-es-main .lead { color: var(--text); margin-top: 0; }
.que-es-main strong { color: var(--text); }

.que-es-side { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.edge-card {
    background: var(--surface);
    padding: 34px 34px 38px;
    position: relative;
    transition: background 0.3s;
}
.edge-card:hover { background: var(--surface-2); }
.edge-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.4s var(--ease);
}
.edge-card:hover::before { transform: scaleY(1); }
.edge-index {
    color: var(--accent);
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 16px;
}
.edge-card h3 { font-size: 1.2rem; margin-bottom: 12px; }
.edge-card p { color: var(--text-dim); font-size: 0.95rem; }

/* Cita de valor */
.value-quote {
    margin: 100px auto 0;
    max-width: 900px;
    text-align: center;
    position: relative;
    padding: 0 20px;
}
.value-quote p {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    line-height: 1.4;
    letter-spacing: -0.01em;
}
.value-quote .serif { font-size: 1.08em; }

/* Pipeline */
.pipeline { margin-top: 110px; }
.pipeline-label { color: var(--text-faint); margin-bottom: 44px; }
.pipeline-track { position: relative; }
.pipeline-line {
    position: absolute;
    top: 21px;
    left: 4%;
    right: 4%;
    height: 2px;
    background: var(--line-strong);
}
.pipeline-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0;
    background: linear-gradient(90deg, var(--olive), var(--accent));
    box-shadow: 0 0 14px rgba(141, 204, 51, 0.55);
    transition: width 0.9s var(--ease);
}
.pipeline-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    position: relative;
}
.p-step { text-align: center; }
.p-node {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--ink);
    color: var(--text-dim);
    font-size: 0.72rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    transition: border-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.p-step:hover .p-node {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 22px rgba(141, 204, 51, 0.35);
}

/* Etapa activa (orquestada por JS al paso del documento) */
.p-step { transition: transform 0.45s var(--ease); }
.p-step h4 { transition: color 0.3s; }
.p-step p { transition: color 0.3s; }
.p-step.active { transform: translateY(-5px); }
.p-step.active .p-node {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(141, 204, 51, 0.1);
    box-shadow: 0 0 28px rgba(141, 204, 51, 0.5);
}
.p-step.active h4 { color: var(--accent); }
.p-step.active p { color: var(--text-dim); }

/* Documento viajero (posición controlada por JS) */
.pipeline-doc {
    position: absolute;
    top: 3px;
    left: 0;
    width: 28px;
    height: 36px;
    margin-left: -14px;
    background: #EDF2F7;
    border-radius: 3px;
    padding: 9px 6px 6px;
    display: grid;
    gap: 4px;
    align-content: start;
    z-index: 2;
    opacity: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 18px rgba(141, 204, 51, 0.35);
    transition: left 0.9s var(--ease), opacity 0.5s, box-shadow 0.5s, outline-color 0.5s;
    outline: 1px solid transparent;
}
.pipeline-doc.moving { animation: doc-bob 0.9s ease-in-out; }
@keyframes doc-bob { 50% { transform: translateY(-11px) rotate(5deg); } }
.pipeline-doc i {
    display: block;
    height: 3px;
    border-radius: 1px;
    background: #9FAEC0;
}
.pipeline-doc i:nth-child(3) { width: 70%; }
.pipeline-doc i:nth-child(4) { width: 50%; }
.pipeline-doc-fold {
    position: absolute;
    top: 0; right: 0;
    width: 9px; height: 9px;
    background: var(--ink);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.pipeline-doc-fold::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #C4CEDA;
    clip-path: polygon(0 0, 0 100%, 100% 100%);
}

/* Etapa 1 — copias dispersas que se fusionan */
.pdoc-ghost {
    position: absolute;
    inset: 0;
    background: rgba(237, 242, 247, 0.55);
    border-radius: 3px;
    opacity: 0;
    pointer-events: none;
}
.st-gather .pdoc-ghost.g1 { animation: ghost-in-1 1.5s ease-out infinite; }
.st-gather .pdoc-ghost.g2 { animation: ghost-in-2 1.5s ease-out 0.35s infinite; }
@keyframes ghost-in-1 {
    0% { opacity: 0.85; transform: translate(-34px, -18px) rotate(-12deg); }
    55% { opacity: 0; transform: none; }
    100% { opacity: 0; }
}
@keyframes ghost-in-2 {
    0% { opacity: 0.7; transform: translate(30px, 16px) rotate(9deg); }
    55% { opacity: 0; transform: none; }
    100% { opacity: 0; }
}

/* Etapa 2 — láser de IA */
.pdoc-laser {
    position: absolute;
    left: 2px; right: 2px;
    top: 2px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 9px 2px rgba(141, 204, 51, 0.75);
    opacity: 0;
}
.st-ai .pdoc-laser { opacity: 1; animation: pdoc-scan 1.1s ease-in-out infinite; }
@keyframes pdoc-scan {
    0%, 100% { top: 2px; }
    50% { top: calc(100% - 5px); }
}
.st-ai i { animation: line-read 1.1s ease-in-out infinite; }

/* Etapa 3 — indexado en repositorio */
.st-repo {
    outline-color: var(--accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 28px rgba(141, 204, 51, 0.6);
}

/* Etapa 4 — lazos a trabajador y activo */
.pdoc-chip {
    position: absolute;
    top: 50%;
    width: 27px; height: 27px;
    margin-top: -14px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--accent-line);
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    transform: scale(0);
    transition: transform 0.4s var(--ease);
}
.pdoc-chip::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 13px;
    height: 1px;
    background: var(--accent-line);
}
.pdoc-chip.c1 { left: -41px; }
.pdoc-chip.c1::before { left: 100%; }
.pdoc-chip.c2 { right: -41px; transition-delay: 0.15s; }
.pdoc-chip.c2::before { right: 100%; }
.st-link .pdoc-chip { transform: scale(1); }

/* Etapa 5 — acreditado y disponible */
.pdoc-check {
    position: absolute;
    top: -9px; right: -10px;
    width: 19px; height: 19px;
    border-radius: 50%;
    background: var(--accent);
    color: #0A1400;
    font-size: 0.62rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    transform: scale(0);
    transition: transform 0.35s var(--ease);
    box-shadow: 0 0 14px rgba(141, 204, 51, 0.6);
}
.st-app .pdoc-check { transform: scale(1); }
.st-app {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 38px rgba(141, 204, 51, 0.8);
}

/* --- Sección 01 compactada de forma proporcionada --- */
#que-es { padding: 80px 0 70px; }
#que-es .sec-head { margin-bottom: 44px; }

/* Columnas alineadas al tope; tarjetas ajustadas a su contenido */
#que-es .que-es-cols { gap: 56px; align-items: start; }
#que-es .edge-card { padding: 26px 30px; }
#que-es .edge-card h3 { margin-bottom: 10px; }
#que-es .edge-card p { font-size: 0.93rem; }

/* Cita y pipeline más cerca del contenido */
#que-es .value-quote { margin-top: 64px; }
#que-es .pipeline { margin-top: 70px; }

/* Ticker de narración */
.pipeline-status {
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 5px;
    padding: 13px 18px;
    color: var(--text-dim);
    min-height: 46px;
    text-transform: none;
    letter-spacing: 0.05em;
    font-size: 0.76rem;
}
.ps-prompt { color: var(--accent); flex-shrink: 0; }
.ps-cursor {
    width: 7px; height: 13px;
    background: var(--accent);
    flex-shrink: 0;
    animation: blink 0.9s steps(1) infinite;
}
.p-step h4 { font-size: 1rem; margin-bottom: 8px; }
.p-step p { font-size: 0.82rem; color: var(--text-faint); }

/* ==========================================================================
   02 · BENTO SOLUCIONAMOS
   ========================================================================== */
.bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}
.bento-card {
    grid-column: span 2;
    background: var(--ink-2);
    padding: 44px 38px 48px;
    position: relative;
    overflow: hidden;
    transition: background 0.35s;
}
.bento-wide { grid-column: span 3; }
.bento-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(141, 204, 51, 0.08), transparent 65%);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
}
.bento-card:hover { background: var(--surface); }
.bento-card:hover::after { opacity: 1; }
.bento-num {
    position: absolute;
    top: 22px; right: 24px;
    color: var(--text-faint);
    font-size: 0.72rem;
}
.bento-icon {
    width: 46px; height: 46px;
    color: var(--accent);
    margin-bottom: 26px;
}
.bento-icon svg { width: 100%; height: 100%; }
.bento-card h3 { font-size: 1.3rem; margin-bottom: 14px; }
.bento-card p { color: var(--text-dim); font-size: 0.95rem; }

/* ==========================================================================
   03 · TECNOLOGÍA
   ========================================================================== */
.tech-split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 70px;
    align-items: center;
}
.tech-items { margin-top: 46px; display: grid; gap: 0; }
.tech-item {
    display: flex;
    gap: 26px;
    padding: 30px 0;
    border-top: 1px solid var(--line);
}
.tech-item:last-child { border-bottom: 1px solid var(--line); }
.tech-item-num {
    color: var(--accent);
    font-size: 0.78rem;
    padding-top: 5px;
    flex-shrink: 0;
}
.tech-item h3 { font-size: 1.15rem; margin-bottom: 10px; }
.tech-item p { color: var(--text-dim); font-size: 0.95rem; }

.visual-frame {
    position: relative;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 14px;
    background: var(--surface);
    box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85);
}
.visual-frame::before, .visual-frame::after {
    content: '+';
    position: absolute;
    font-family: var(--f-mono);
    color: var(--accent);
    font-size: 1rem;
    line-height: 1;
}
.visual-frame::before { top: -9px; left: -6px; }
.visual-frame::after { bottom: -9px; right: -6px; }
.visual-frame img { border-radius: 4px; width: 100%; }
.visual-tag {
    position: absolute;
    top: -11px;
    left: 28px;
    background: var(--ink);
    color: var(--text-faint);
    padding: 2px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    z-index: 1;
}

/* ==========================================================================
   04 · CASO DE ÉXITO
   ========================================================================== */
.section-exito {
    background:
        radial-gradient(ellipse 70% 55% at 50% 0%, rgba(141, 204, 51, 0.06), transparent 70%),
        var(--ink);
}

.mega-stat {
    display: flex;
    align-items: center;
    gap: 54px;
    margin: 8px 0 44px;
    flex-wrap: wrap;
}
.mega-num {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(5rem, 11vw, 9.5rem);
    line-height: 0.9;
    letter-spacing: -0.045em;
    color: var(--accent);
    text-shadow: 0 0 90px rgba(141, 204, 51, 0.3);
    display: flex;
    align-items: baseline;
}
.mega-pct { font-size: 0.42em; margin-left: 6px; color: var(--text); }
.mega-caption {
    font-family: var(--f-display);
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    font-weight: 600;
    line-height: 1.45;
    max-width: 460px;
}
.mega-caption .muted { font-weight: 400; font-size: 0.82em; }
.mega-caption strong { color: var(--text); }
.mega-caption strong.accent-txt { color: var(--accent); }

.compare { display: grid; gap: 14px; margin-bottom: 48px; }
.compare-row { display: flex; align-items: center; gap: 22px; }
.compare-label { width: 110px; color: var(--text-faint); flex-shrink: 0; text-align: right; }
.compare-track { flex: 1; height: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; }
.compare-fill {
    height: 100%;
    width: 0;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-family: var(--f-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    white-space: nowrap;
    border-radius: 2px;
}
.compare.visible .compare-fill { width: var(--w); transition: width 1.6s var(--ease) 0.2s; }
.compare-fill.before { background: rgba(148, 170, 190, 0.16); color: var(--text-dim); }
.compare-fill.after {
    background: linear-gradient(90deg, var(--olive), var(--accent));
    box-shadow: 0 0 26px rgba(141, 204, 51, 0.35);
}
.compare-fill.after span {
    position: absolute;
    left: calc(100% + 14px);
    color: var(--accent);
    font-weight: 500;
}

.case-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-bottom: 48px;
}
.case-meta-item {
    background: var(--ink);
    padding: 22px 26px;
    display: grid;
    gap: 10px;
    transition: background 0.3s;
}
.case-meta-item:hover { background: var(--surface); }
.case-meta-item > span { color: var(--text-faint); }
.case-meta-item strong {
    font-family: var(--f-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.case-quote { text-align: center; max-width: 820px; margin: 0 auto; }
.case-quote p {
    font-family: var(--f-display);
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 18px;
}
.case-quote .serif { font-size: 1.08em; }
.case-quote footer { color: var(--text-faint); }

/* ==========================================================================
   05 · FACTOR HUMANO
   ========================================================================== */
.method-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 72px;
    align-items: center;
}
.method-left .sec-num { display: inline-block; margin-bottom: 20px; }
.method-left .sec-label { margin-bottom: 12px; }
.method-left h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); margin-bottom: 22px; }
.method-intro {
    color: var(--text-dim);
    font-size: 1.02rem;
    margin-bottom: 34px;
}
.method-intro strong { color: var(--accent); font-weight: 600; }

/* Pestañas de pasos */
.method-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.method-tab {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 9px 16px;
    cursor: pointer;
    transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.method-tab .mono { font-size: 0.7rem; color: var(--text-faint); transition: color 0.25s; }
.method-tab:hover { border-color: var(--accent-line); color: var(--text); }
.method-tab.active {
    color: var(--ink);
    background: var(--accent);
    border-color: var(--accent);
}
.method-tab.active .mono { color: rgba(10, 20, 0, 0.6); }

/* Stepper */
.method-stepper {
    position: relative;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 34px 38px 26px;
    overflow: hidden;
    box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.7);
}
.stepper-progress { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.stepper-progress span {
    display: block;
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, var(--olive), var(--accent));
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(141, 204, 51, 0.5);
    transition: width 0.5s var(--ease);
}
.stepper-viewport { position: relative; margin-top: 30px; min-height: 264px; }
.step-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.step-slide.active { opacity: 1; transform: none; pointer-events: auto; position: relative; }
.step-bignum {
    display: block;
    font-size: clamp(4rem, 8vw, 6.5rem);
    line-height: 0.9;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--accent);
    margin-bottom: 18px;
    text-shadow: 0 0 60px rgba(141, 204, 51, 0.18);
}
.step-slide h3 { font-size: 1.7rem; margin-bottom: 14px; }
.step-slide p { color: var(--text-dim); font-size: 1rem; line-height: 1.65; }

.stepper-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.step-count { color: var(--text-faint); }
.step-count #step-current { color: var(--accent); }
.step-arrow {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.step-arrow:hover { border-color: var(--accent); color: var(--accent); }
.step-arrow:active { transform: scale(0.92); }

/* ==========================================================================
   06 · CONTACTO
   ========================================================================== */
.section-contacto {
    background:
        radial-gradient(ellipse 60% 50% at 85% 20%, rgba(141, 204, 51, 0.07), transparent 70%),
        var(--ink);
}
.contact-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 80px;
    align-items: start;
}
.contact-copy .sec-num { display: inline-block; margin-bottom: 26px; }
.contact-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); margin-bottom: 22px; }
.contact-copy .lead { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 44px; }
.contact-mail {
    display: inline-flex;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--accent);
    border-bottom: 1px solid var(--accent-line);
    padding-bottom: 6px;
    transition: gap 0.25s var(--ease);
}
.contact-mail:hover { gap: 20px; }
.contact-badges {
    margin-top: 56px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-faint);
}
.contact-badges .gc-logo { height: 26px; width: auto; opacity: 0.85; }

.contact-form-wrap { position: relative; }
.contact-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 44px 40px;
    display: grid;
    gap: 24px;
}
.form-title { color: var(--text-faint); margin-bottom: 4px; }
.field { display: grid; gap: 9px; }
.field label { color: var(--text-faint); }
.field input, .field textarea {
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 14px 16px;
    color: var(--text);
    font-family: var(--f-body);
    font-size: 0.95rem;
    transition: border-color 0.25s, box-shadow 0.25s;
    width: 100%;
    resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:focus, .field textarea:focus {
    outline: none;
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px rgba(141, 204, 51, 0.12);
}
.captcha-field label span { color: var(--accent); }

.form-success {
    position: absolute;
    inset: 0;
    background: var(--surface);
    border: 1px solid var(--accent-line);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    gap: 14px;
    animation: success-in 0.5s var(--ease);
}
.form-success[hidden] { display: none; }
@keyframes success-in { from { opacity: 0; transform: scale(0.96); } }
.success-ring {
    width: 72px; height: 72px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    color: var(--accent);
    box-shadow: 0 0 34px rgba(141, 204, 51, 0.35);
    margin-bottom: 8px;
}
.form-success h3 { font-size: 1.4rem; }
.form-success p { color: var(--text-dim); font-size: 0.95rem; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { border-top: 1px solid var(--line); background: var(--ink-2); }
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 1.1fr;
    gap: 60px;
    padding-top: 80px;
    padding-bottom: 70px;
}
.footer-logo { height: 44px; width: auto; margin-bottom: 20px; }
.footer-brand > p { color: var(--text-dim); font-size: 0.92rem; max-width: 340px; }
.footer-partners { margin-top: 34px; display: flex; gap: 40px; flex-wrap: wrap; }
.partner { display: grid; gap: 10px; }
.partner span { color: var(--text-faint); }
.partner img { height: 30px; width: auto; opacity: 0.8; }

.footer-nav { display: grid; gap: 13px; align-content: start; }
.footer-nav > p { color: var(--text-faint); margin-bottom: 10px; }
.footer-nav a {
    font-size: 0.9rem;
    color: var(--text-dim);
    transition: color 0.25s, transform 0.25s var(--ease);
    width: fit-content;
}
.footer-nav a:hover { color: var(--accent); transform: translateX(5px); }
.footer-brochure { color: var(--accent) !important; margin-top: 8px; }

.footer-legal { align-content: start; display: grid; gap: 14px; }
.footer-legal > p:first-child { color: var(--text-faint); }
.footer-legal > p:nth-child(2) { color: var(--text-dim); font-size: 0.85rem; }
.footer-gc { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.footer-gc span { color: var(--text-faint); }
.footer-gc img { height: 24px; width: auto; opacity: 0.85; }

.footer-bottom { border-top: 1px solid var(--line); padding: 22px 0; }
.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-faint);
}

/* ==========================================================================
   TEMA CLARO — secciones intercaladas (flip de tokens)
   ========================================================================== */
.theme-light {
    --ink: #EEF2F7;
    --ink-2: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F3F6FA;
    --line: rgba(12, 30, 54, 0.12);
    --line-strong: rgba(12, 30, 54, 0.22);
    --text: #0C1B2E;
    --text-dim: #47586D;
    --text-faint: #71829A;
    --accent-soft: rgba(141, 204, 51, 0.18);
    background: var(--ink);
    color: var(--text);
}
/* Acentos de texto: lima puro pierde contraste sobre claro → verde más profundo */
.theme-light em.accent,
.theme-light .accent-txt,
.theme-light .sec-num,
.theme-light .sec-label.mono,
.theme-light .bento-icon,
.theme-light .tech-item-num,
.theme-light .form-title,
.theme-light .contact-mail { color: #5E8F1E; }
.theme-light .sec-num { border-color: rgba(94, 143, 30, 0.4); }
.theme-light .mega-num { color: #5E8F1E; text-shadow: 0 0 60px rgba(141, 204, 51, 0.22); }
.theme-light .compare-fill.before { background: rgba(12, 30, 54, 0.12); color: var(--text-dim); }
.theme-light .contact-mail { border-bottom-color: rgba(94, 143, 30, 0.4); }

/* ==========================================================================
   SEPARADOR DE HOJA entre secciones
   ========================================================================== */
.leaf-divider {
    position: relative;
    width: 100%;
    height: 3px;
    background: var(--accent);
    z-index: 10;
    box-shadow: 0 0 18px rgba(141, 204, 51, 0.4);
}
.leaf-divider img {
    position: absolute;
    bottom: 0;
    right: 80px;
    height: 60px;
    width: auto;
    pointer-events: none;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25));
}
.leaf-divider.flip img {
    right: auto;
    left: 80px;
    transform: scaleX(-1);
}
@media (max-width: 768px) {
    .leaf-divider img { right: 34px; height: 46px; }
    .leaf-divider.flip img { left: 34px; right: auto; }
}

/* ==========================================================================
   REVEAL ON SCROLL
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }
.d-1 { transition-delay: 0.08s; }
.d-2 { transition-delay: 0.16s; }
.d-3 { transition-delay: 0.24s; }
.d-4 { transition-delay: 0.34s; }
.d-5 { transition-delay: 0.44s; }
.d-6 { transition-delay: 0.54s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
    .hero-layout { grid-template-columns: 1fr; gap: 56px; }
    .hero-visual { max-width: 640px; }
    .bento-card, .bento-wide { grid-column: span 3; }
    .bento-card:last-child { grid-column: span 6; }
    .case-meta { grid-template-columns: repeat(2, 1fr); }
    .tech-split, .contact-split, .que-es-cols { grid-template-columns: 1fr; gap: 56px; }
}

@media (max-width: 820px) {
    .main-nav {
        position: fixed;
        top: 76px;
        left: 0; right: 0;
        background: rgba(4, 8, 13, 0.97);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        gap: 0;
        padding: 12px 28px 24px;
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s, transform 0.3s var(--ease);
    }
    .main-nav.open { opacity: 1; transform: none; pointer-events: auto; }
    .main-nav .nav-link { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
    .main-nav .nav-link::before { opacity: 1; }
    .nav-toggle { display: flex; }
    .header-right .btn { display: none; }

    .section { padding: 90px 0; }
    .sec-head { flex-direction: column; gap: 18px; margin-bottom: 50px; }
    .sec-num { margin-top: 0; }

    .hero { padding-top: 110px; }
    .hero-stats { grid-template-columns: 1fr; gap: 22px; }

    .scanner-stage {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 16px;
        padding: 24px 20px;
    }
    .scan-arrow { flex-direction: row; }
    .scan-arrow-line { width: 44px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-line), transparent); }
    .scan-arrow-line::after { display: none; }
    .scan-fields { width: 100%; }
    .scanner-foot-label { display: none; }

    .pipeline-line, .pipeline-doc { display: none; }
    .pipeline-steps { grid-template-columns: 1fr; gap: 34px; }
    .p-step { text-align: left; display: grid; grid-template-columns: 44px 1fr; gap: 6px 20px; }
    .p-step .p-node { margin-bottom: 0; grid-row: span 2; }

    .bento-card, .bento-wide { grid-column: span 6; padding: 36px 28px; }

    .mega-stat { gap: 24px; }
    .compare-label { width: 78px; font-size: 0.62rem; }
    .case-meta { grid-template-columns: 1fr; }

    .method-split { grid-template-columns: 1fr; gap: 40px; }
    .method-stepper { padding: 26px 24px 22px; }
    .stepper-viewport { min-height: 280px; }

    .contact-form { padding: 32px 24px; }
    .footer-grid { grid-template-columns: 1fr; gap: 48px; }
}
