/* ==========================================================
   Modelix Systems — "cuaderno científico"
   Fondo blanco, tinta azul profunda, acento cian (del hero)
   ========================================================== */
:root {
    --paper: #ffffff;
    --paper-2: #f7f9fb;
    --ink: #0b1a2c;
    --ink-2: #33475c;
    --muted: #6a7b8e;
    --line: #e4e9ef;
    --line-strong: #cfd8e2;

    --accent: #0aa5b8;
    --accent-deep: #067684;
    --accent-soft: #e8f7f9;
    --signal: #f2643a;

    /* Hero / contacto (sobre imagen oscura) */
    --night: #050a12;
    --night-text: #ffffff;
    --night-muted: #b4c3d3;
    --cyan: #00e5ff;
    --gradient-main: linear-gradient(135deg, #00e5ff 0%, #00bfa6 50%, #3d7aed 100%);

    --font-display: 'Instrument Serif', 'Times New Roman', serif;
    --font-body: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    --gutter: clamp(1.25rem, 5vw, 6rem);
    --max: 1280px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }

h1, h2, h3, h4 { font-weight: 400; letter-spacing: -0.01em; }

em { font-style: italic; }

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

/* ================= NAV ================= */
.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: 68px;
    padding: 0 var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

/* El blur va en un pseudo-elemento para no crear un contenedor
   que rompa el menú móvil (position: fixed) */
.navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    transition: background 0.3s ease;
}

.navbar.scrolled { border-bottom-color: var(--line); }
.navbar.scrolled::before { background: rgba(255, 255, 255, 0.97); }

.logo {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.22em;
    white-space: nowrap;
    color: var(--ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.logo-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    margin-left: 0.15rem;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.nav-links {
    display: flex;
    gap: clamp(1rem, 2vw, 2.2rem);
    list-style: none;
}

.nav-links a {
    position: relative;
    color: var(--ink-2);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.4rem 0;
    transition: color 0.25s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1.5px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
}

.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switch {
    position: relative;
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--paper);
}

.lang-btn {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    cursor: pointer;
    transition: color 0.25s ease, background 0.25s ease;
}

.lang-btn.active {
    background: var(--ink);
    color: #fff;
}

.lang-btn:not(.active):hover { color: var(--ink); }

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: var(--ink);
    transition: 0.3s ease;
    transform-origin: center;
}

.mobile-menu-btn.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ================= BOTONES ================= */
.btn-primary,
.btn-secondary,
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    padding: 0.95rem 1.8rem;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn-primary {
    background: var(--gradient-main);
    color: var(--night);
    border: none;
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.3);
}

.btn-primary::after {
    content: '→';
    font-family: var(--font-mono);
    transition: transform 0.3s var(--ease);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 34px rgba(0, 229, 255, 0.45);
}

.btn-primary:hover::after { transform: translateX(4px); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    border-color: var(--cyan);
    background: rgba(0, 229, 255, 0.1);
}

/* ================= HERO (imagen intacta) ================= */
.hero-scroll-container {
    position: relative;
    height: 400vh;
    z-index: 10;
    background: var(--night);
}

.hero {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(5, 10, 18, 0.45) 0%, rgba(5, 10, 18, 0.78) 100%);
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 920px;
    padding: 68px 2rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--night-text);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6.6vw, 5.6rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin-bottom: 1.75rem;
    text-shadow: 0 2px 40px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s var(--ease) 0.1s both;
}

.hero h1 em {
    background: linear-gradient(120deg, #7ff3ff 0%, #00e5ff 45%, #3ef0c4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 0.08em;
}

.hero-description {
    font-size: clamp(1rem, 1.35vw, 1.15rem);
    font-weight: 300;
    color: #dbe6f0;
    max-width: 680px;
    margin-bottom: 1rem;
    text-shadow: 0 1px 20px rgba(0, 0, 0, 0.6);
    animation: fadeInUp 1s var(--ease) 0.25s both;
}

.hero-description--sub {
    font-size: 0.95rem;
    color: var(--night-muted);
    max-width: 600px;
    margin-bottom: 2.5rem;
    animation-delay: 0.35s;
}

.hero-buttons {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 1s var(--ease) 0.45s both;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--night-muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    animation: fadeIn 1s ease 0.8s both;
}

.scroll-arrow {
    width: 14px;
    height: 14px;
    border-right: 1.5px solid var(--cyan);
    border-bottom: 1.5px solid var(--cyan);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.5; }
    50% { transform: rotate(45deg) translateY(6px); opacity: 1; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= PAPEL / SECCIONES ================= */
.paper {
    position: relative;
    z-index: 10;
    background: var(--paper);
}

.section {
    position: relative;
    padding: clamp(5rem, 10vw, 8.5rem) var(--gutter);
    max-width: calc(var(--max) + var(--gutter) * 2);
    margin: 0 auto;
}

.section + .section::before {
    content: '';
    position: absolute;
    top: 0;
    left: var(--gutter);
    right: var(--gutter);
    height: 1px;
    background: var(--line);
}

.sec-head {
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
    max-width: 820px;
}

.sec-label {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin-bottom: 1.4rem;
}

.sec-label::after {
    content: '';
    flex: 0 0 56px;
    height: 1px;
    background: var(--line-strong);
}

.sec-index {
    color: var(--accent-deep);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--accent);
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.sec-head h2 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 4.1rem);
    line-height: 1.04;
    color: var(--ink);
    margin-bottom: 1.2rem;
}

.sec-head h2 em,
.solution-intro h2 em { color: var(--accent-deep); }

.sec-head p {
    font-size: 1.08rem;
    font-weight: 300;
    color: var(--ink-2);
    max-width: 640px;
}

.sec-head--split {
    max-width: none;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    column-gap: 4rem;
    align-items: end;
}

.sec-head--split .sec-label { grid-column: 1 / -1; }
.sec-head--split h2 { margin-bottom: 0; }
.sec-head--split p { padding-bottom: 0.4rem; }

/* ================= 1. SOLUCIONES ================= */
.solutions .sec-head { margin-bottom: 1.5rem; }

.solution-block {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(2rem, 6vw, 6rem);
    padding: clamp(2.5rem, 5vw, 4rem) 0;
    border-top: 1px solid var(--line);
}

.solution-block:first-of-type { border-top: 0; }

.solution-intro {
    position: sticky;
    top: 110px;
    align-self: start;
}

.solution-kicker {
    display: block;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 5.5rem;
    line-height: 0.8;
    color: var(--accent);
    opacity: 0.9;
    margin-bottom: 1rem;
}

.solution-intro h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.6vw, 3rem);
    line-height: 1.06;
    margin-bottom: 1.1rem;
}

.solution-intro p {
    color: var(--ink-2);
    font-weight: 300;
    font-size: 1.04rem;
}

.solution-list { list-style: none; }

.solution-list li {
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    gap: 1rem;
    padding: 1.6rem 0;
    border-bottom: 1px solid var(--line);
    position: relative;
}

.solution-list li:first-child { border-top: 1px solid var(--line); }

.solution-list li::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 1px;
    width: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease);
}

.solution-list li:hover::before { transform: scaleX(1); }

.item-n {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-deep);
    padding-top: 0.35rem;
}

.solution-list h3 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.12rem;
    letter-spacing: -0.005em;
    margin-bottom: 0.35rem;
    transition: color 0.3s ease;
}

.solution-list li:hover h3 { color: var(--accent-deep); }

.solution-list p {
    color: var(--muted);
    font-size: 0.96rem;
}

/* ================= 2. MODALIDADES ================= */
.delivery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.delivery-card {
    position: relative;
    padding: 2.4rem 1.9rem 2.6rem;
    border-right: 1px solid var(--line);
    background: var(--paper);
    transition: background 0.4s ease;
}

.delivery-card:last-child { border-right: 0; }

.delivery-card:hover { background: var(--paper-2); }

.delivery-icon {
    width: 46px;
    height: 46px;
    stroke: var(--ink);
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-bottom: 2.6rem;
    transition: stroke 0.3s ease, transform 0.5s var(--ease);
}

.delivery-card:hover .delivery-icon {
    stroke: var(--accent-deep);
    transform: translateY(-4px);
}

.delivery-card h3 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    line-height: 1.1;
    margin-bottom: 0.7rem;
}

.delivery-card p {
    font-size: 0.94rem;
    color: var(--muted);
}

/* ================= 3. TECNOLOGÍA ================= */
.tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.tech-card {
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    background: var(--paper);
    transition: border-color 0.3s ease, box-shadow 0.4s ease;
}

.tech-card:hover {
    border-color: var(--line-strong);
    box-shadow: 0 24px 50px -30px rgba(11, 26, 44, 0.35);
}

.tech-visual {
    aspect-ratio: 420 / 240;
    border-bottom: 1px solid var(--line);
    background-color: var(--paper-2);
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: -1px -1px;
}

.tech-visual svg { width: 100%; height: 100%; display: block; }

.tech-body { padding: 2rem 2.2rem 2.4rem; }

.tech-body h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 0.8rem;
}

.tech-body p {
    color: var(--ink-2);
    font-weight: 300;
}

/* SVG decorativos */
.v-contour { fill: none; stroke: var(--accent); stroke-opacity: var(--o); stroke-width: 1.2; }
.v-region { fill: var(--accent); fill-opacity: 0.08; stroke: none; }
.v-constraint { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.45; }
.v-path { fill: none; stroke: var(--signal); stroke-width: 1.8; stroke-linejoin: round; }
.v-opt { fill: var(--signal); }
.v-opt-ring { fill: none; stroke: var(--signal); stroke-opacity: 0.4; animation: ring 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.v-math { font-family: var(--font-mono); font-size: 13px; fill: var(--ink); }
.v-math--muted { fill: var(--muted); font-size: 11.5px; }
.v-label { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); }
.v-axis { stroke: var(--ink); stroke-opacity: 0.5; stroke-width: 1; }
.v-target { stroke: var(--signal); stroke-dasharray: 3 5; stroke-width: 1; opacity: 0.7; }
.v-walk { fill: none; stroke: var(--ink); stroke-opacity: 0.12; stroke-width: 1; }
.v-walk--best { stroke: var(--accent); stroke-opacity: 1; stroke-width: 2; }
.v-cell { fill: var(--accent); transition: opacity 0.6s ease var(--d); opacity: 0; }
.v-cell--0 { fill: #dfe7ee; }
.v-cell--1 { fill-opacity: 0.25; }
.v-cell--2 { fill-opacity: 0.55; }
.v-cell--3 { fill: var(--accent-deep); }
.v-field { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 4; opacity: 0.4; }
.v-grid { stroke: var(--line); stroke-width: 1; }
.v-bar { transform-box: fill-box; transform-origin: left; transform: scaleX(0); transition: transform 0.9s var(--ease) var(--d); }
.v-bar--a { fill: var(--accent); }
.v-bar--b { fill: var(--ink); }
.v-dot { fill: var(--line-strong); }
.v-route { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.v-route--0 { stroke: var(--accent); }
.v-route--1 { stroke: var(--ink); }
.v-route--2 { stroke: var(--signal); }
.v-stop { fill: var(--paper); stroke-width: 1.8; }
.v-stop--0 { stroke: var(--accent); }
.v-stop--1 { stroke: var(--ink); }
.v-stop--2 { stroke: var(--signal); }
.v-depot { fill: var(--ink); }

.draw { stroke-dasharray: var(--len, 1000); stroke-dashoffset: var(--len, 1000); }

.visible .draw { animation: draw 2.2s var(--ease) 0.3s forwards; }
.visible .v-cell { opacity: 1; }
.visible .v-bar { transform: scaleX(1); }

@keyframes draw { to { stroke-dashoffset: 0; } }

@keyframes ring {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* ================= 4. PROYECTOS ================= */
.project-list { border-top: 1px solid var(--ink); }

.project {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1.3fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    padding: clamp(2.5rem, 4vw, 3.5rem) 0;
    border-bottom: 1px solid var(--line);
    align-items: start;
}

.project-num {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 3.4rem;
    line-height: 0.9;
    color: var(--accent);
}

.project-text h3 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.06;
    margin-bottom: 1.1rem;
}

.project-text p {
    color: var(--ink-2);
    font-weight: 300;
    margin-bottom: 0.8rem;
}

.project-text p + p {
    color: var(--muted);
    font-size: 0.96rem;
    padding-left: 1rem;
    border-left: 2px solid var(--accent-soft);
}

.project-visual {
    aspect-ratio: 320 / 220;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper-2);
}

.project-visual svg { width: 100%; height: 100%; display: block; }

/* ================= 5. METODOLOGÍA ================= */
.approach-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    counter-reset: step;
}

.approach-step {
    position: relative;
    padding: 2.2rem 1.6rem 0 0;
}

.approach-step::before,
.approach-step::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
}

.approach-step::before { right: 0; background: var(--line); }

.approach-step::after {
    width: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s var(--ease);
}

.approach-step.visible::after { transform: scaleX(1); }
.approach-step:nth-child(2)::after { transition-delay: 0.15s; }
.approach-step:nth-child(3)::after { transition-delay: 0.3s; }
.approach-step:nth-child(4)::after { transition-delay: 0.45s; }
.approach-step:nth-child(5)::after { transition-delay: 0.6s; }

.step-num {
    position: absolute;
    top: -6px;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--accent);
    font-size: 0;
    z-index: 2;
}

.approach-step h3 {
    font-family: var(--font-display);
    font-size: 1.9rem;
    margin-bottom: 0.7rem;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.approach-step h3::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-deep);
}

.approach-step p {
    color: var(--muted);
    font-size: 0.93rem;
}

/* ================= 6. DEMO ================= */
.demo-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.demo-step {
    position: relative;
    padding: 1.4rem 0 0;
    border-top: 2px solid var(--line);
    transition: border-color 0.5s ease;
}

.demo-step.is-active { border-top-color: var(--accent); }

.demo-step-n {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.9rem;
    transition: 0.4s ease;
}

.demo-step.is-active .demo-step-n {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.demo-step.is-current .demo-step-n { box-shadow: 0 0 0 5px var(--accent-soft); }

.demo-step h3 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.08rem;
    margin-bottom: 0.4rem;
}

.demo-step p {
    font-size: 0.92rem;
    color: var(--muted);
}

.demo-console {
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 30px 70px -40px rgba(11, 26, 44, 0.35);
    overflow: hidden;
}

.console-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--line);
    background: var(--paper-2);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--muted);
}

.console-dots { display: inline-flex; gap: 6px; }
.console-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }

.console-title { flex: 1; }

.console-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.68rem;
}

.console-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--line-strong);
}

.console-status[data-state="running"] { color: var(--signal); }
.console-status[data-state="running"]::before { background: var(--signal); animation: blink 0.8s ease infinite; }
.console-status[data-state="done"] { color: var(--accent-deep); }
.console-status[data-state="done"]::before { background: var(--accent); }

@keyframes blink { 50% { opacity: 0.2; } }

.console-body { padding: clamp(1.2rem, 3vw, 2rem); }

.data-table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    min-width: 680px;
}

.data-table th,
.data-table td {
    padding: 0.55rem 0.5rem;
    text-align: right;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-table thead th {
    color: var(--muted);
    font-weight: 400;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.data-table th:first-child {
    text-align: left;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--ink);
    font-size: 0.82rem;
    text-transform: none;
    letter-spacing: 0;
}

.data-table tbody tr:first-child td { color: var(--signal); }

.data-params {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    margin-top: 1rem;
    font-size: 0.82rem;
}

.data-params div { display: flex; gap: 0.6rem; }
.data-params dt { color: var(--muted); }
.data-params dd { font-family: var(--font-mono); color: var(--ink); }

.demo-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-top: 1.6rem;
    padding-top: 1.6rem;
    border-top: 1px dashed var(--line-strong);
}

.demo-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.88rem;
    color: var(--ink-2);
}

.demo-slider input[type="range"] {
    width: 180px;
    accent-color: var(--accent);
}

.demo-slider output {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink);
    min-width: 3.2em;
}

.btn-run {
    box-shadow: none;
    background: var(--ink);
    color: #fff;
}

.btn-run:hover { background: var(--accent-deep); box-shadow: 0 10px 30px -10px rgba(6, 118, 132, 0.6); }
.btn-run:disabled { opacity: 0.5; cursor: progress; transform: none; }

.demo-log {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-2);
}

.demo-log:not(:empty) { margin-top: 1.4rem; }

.log-line {
    display: flex;
    gap: 0.7rem;
    padding: 0.18rem 0;
    animation: fadeInUp 0.4s var(--ease) both;
}

.log-prompt { color: var(--accent); }
.log-active::after { content: '▍'; color: var(--accent); animation: blink 0.8s step-end infinite; }
.log-ok { color: var(--accent-deep); font-weight: 500; }

.demo-results { display: none; }

.has-results .demo-results {
    display: block;
    margin-top: 1.6rem;
    animation: fadeInUp 0.7s var(--ease) both;
}

.demo-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.kpi {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1.1rem 1.3rem;
    border-right: 1px solid var(--line);
}

.kpi:last-child { border-right: 0; }

.kpi-label { font-size: 0.8rem; color: var(--muted); }

.kpi-value {
    font-family: var(--font-display);
    font-size: 2.4rem;
    line-height: 1.05;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.kpi--hl .kpi-value { color: var(--accent-deep); }

.kpi-sub {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
}

.demo-chart { margin-top: 1.4rem; }
.demo-chart svg { width: 100%; height: auto; display: block; }

.c-grid { stroke: var(--line); stroke-width: 1; }
.c-tick { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); }
.c-bar { fill: var(--accent); }
.c-bar-g { transform-box: fill-box; transform-origin: bottom; }
.c-cap { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.c-dem { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linejoin: round; }
.c-dem-dot { fill: var(--paper); stroke: var(--signal); stroke-width: 2; }
.c-inv-area { fill: var(--ink); fill-opacity: 0.06; }
.c-inv-line { fill: none; stroke: var(--ink); stroke-opacity: 0.5; stroke-width: 1.2; }
.c-short { fill: var(--signal); }

.chart--animate .c-bar-g { animation: grow 0.8s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.chart--animate .c-dem { stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200); animation: draw 1.4s var(--ease) 0.4s forwards; }
.chart--animate .c-dem-dot { animation: fadeIn 0.3s ease both; animation-delay: calc(0.5s + var(--i) * 80ms); }
.chart--animate .c-inv-area,
.chart--animate .c-inv-line { animation: fadeIn 1s ease 0.6s both; }

@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Gráfico compacto (móvil) */
.chart--compact .c-tick { font-size: 13px; }
.chart--compact .c-band-label { font-size: 13px; }
.chart--compact .c-dem { stroke-width: 2.2; }

/* Datos de entrada compactos (móvil) */
.data-grid-key { display: flex; gap: 1.2rem; font-size: 0.8rem; color: var(--ink-2); margin-bottom: 0.7rem; }
.data-grid-key .k { display: inline-flex; align-items: center; gap: 0.4rem; }
.data-grid-key .k::before { content: ''; width: 8px; height: 8px; border-radius: 2px; }
.data-grid-key .k-d::before { background: var(--signal); }
.data-grid-key .k-c::before { background: var(--ink); }
.data-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.dg-cell { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.55rem 0.6rem; background: var(--paper); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.dg-m { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.dg-d { font-size: 0.88rem; color: var(--signal); }
.dg-c { font-size: 0.88rem; color: var(--ink); }

/* Etapas del plan */
.c-band--build .c-band-bg { fill: var(--accent); fill-opacity: 0.07; }
.c-band--build .c-band-top { stroke: var(--accent); stroke-width: 2; }
.c-band--build .c-band-label { fill: var(--accent-deep); }
.c-band--peak .c-band-bg { fill: var(--signal); fill-opacity: 0.07; }
.c-band--peak .c-band-top { stroke: var(--signal); stroke-width: 2; }
.c-band--peak .c-band-label { fill: #c2421c; }
.c-band-label { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }
.c-short-label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; fill: #fff; }

.chart--animate .c-band { animation: fadeIn 0.8s ease both; animation-delay: calc(1.3s + var(--k) * 0.35s); }
.chart--animate .c-short-g { animation: fadeIn 0.5s ease 2s both; }

/* Cómo leer este resultado */
.demo-reading {
    margin-top: 1.6rem;
    padding: 1.4rem 1.6rem;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.reading-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

.reading-list { list-style: none; display: grid; gap: 0.85rem; }

.reading-list li {
    display: grid;
    grid-template-columns: 1.6rem 1fr;
    gap: 0.8rem;
    align-items: start;
    animation: fadeInUp 0.6s var(--ease) both;
    animation-delay: calc(1.4s + var(--i) * 0.35s);
}

.reading-n {
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #fff;
    background: var(--ink);
}

.reading--build .reading-n { background: var(--accent); }
.reading--peak .reading-n { background: var(--signal); }

.reading-list p { font-size: 0.95rem; color: var(--ink-2); line-height: 1.55; }
.reading-list b { color: var(--ink); font-weight: 600; }

.demo-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.6rem;
    padding-top: 0.8rem;
    font-size: 0.8rem;
    color: var(--ink-2);
}

.lg { display: inline-flex; align-items: center; gap: 0.5rem; }
.lg::before { content: ''; display: inline-block; }
.lg-prod::before { width: 10px; height: 10px; background: var(--accent); border-radius: 2px; }
.lg-dem::before { width: 16px; height: 2px; background: var(--signal); }
.lg-cap::before { width: 16px; height: 0; border-top: 1.5px dashed var(--ink); }
.lg-inv::before { width: 12px; height: 10px; background: rgba(11, 26, 44, 0.1); border-top: 1.2px solid rgba(11, 26, 44, 0.5); }
.lg-short::before { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }

/* ================= 7. EXPERIENCIA ================= */
.experience-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 6rem);
    align-items: center;
}

.experience .sec-head { margin-bottom: 0; }

.logo-grid {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.logo-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    aspect-ratio: 4 / 3;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 1.5rem;
    overflow: hidden;
    transition: background 0.4s ease;
}

.logo-cell:hover { background: var(--paper-2); }

.logo-cell span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.logo-img {
    display: block;
    object-fit: contain;
    mix-blend-mode: multiply;
    filter: grayscale(1) contrast(1.05);
    opacity: 0.75;
    transition: filter 0.5s ease, opacity 0.5s ease, transform 0.6s var(--ease);
}

.logo-cell:hover .logo-img {
    filter: none;
    opacity: 1;
    transform: scale(1.04);
}

/* El PNG de Bayer trae un fondo gris incrustado: se recorta al círculo */
.logo-bayer { height: 104px; width: auto; clip-path: circle(46.5% at 50% 48.5%); }
.logo-cell .logo-bayer { filter: grayscale(1) brightness(1.08) contrast(1.25); }
.logo-cell:hover .logo-bayer { filter: brightness(1.08) contrast(1.25); }
.logo-fao { height: 96px; width: auto; }
.logo-santander { height: 150px; width: 230px; object-fit: cover; margin: -26px 0; }
.logo-quiena { height: 78px; width: 78px; border-radius: 18px; mix-blend-mode: normal; }

/* ================= CONTACTO (imagen intacta) ================= */
.cta-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6rem 2rem;
    text-align: center;
    z-index: 10;
    background: var(--night);
    color: var(--night-text);
}

.cta-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.cta-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(5, 10, 18, 0.45) 0%, rgba(5, 10, 18, 0.8) 100%);
    z-index: 2;
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 10;
    max-width: 680px;
    margin: 0 auto;
}

.cta-header { margin-bottom: 2.2rem; }

.cta-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cyan);
    padding: 0.35rem 0.9rem;
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 999px;
    margin-bottom: 1.4rem;
}

.cta-content h2 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1.04;
    margin-bottom: 1.1rem;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

.cta-content p {
    color: #d0dbe6;
    font-weight: 300;
    font-size: 1.06rem;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.contact-form {
    max-width: 540px;
    margin: 0 auto;
    display: grid;
    gap: 0.9rem;
    background: rgba(10, 20, 36, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 229, 255, 0.14);
    border-radius: 14px;
    padding: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

.form-group { text-align: left; }

.form-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--night-muted);
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(18, 31, 56, 0.55);
    border: 1px solid rgba(0, 229, 255, 0.16);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(180, 195, 211, 0.55); }

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
    background: rgba(18, 31, 56, 0.8);
}

.form-group textarea { min-height: 110px; resize: vertical; }

.submit-btn {
    margin-top: 0.4rem;
    border: none;
    background: var(--gradient-main);
    color: var(--night);
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 34px rgba(0, 229, 255, 0.45);
}

/* ================= FOOTER ================= */
.footer {
    position: relative;
    z-index: 10;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: 4rem var(--gutter) 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    max-width: var(--max);
    margin: 0 auto 3rem;
}

.footer-brand p {
    margin-top: 1rem;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--ink-2);
    max-width: 360px;
    line-height: 1.25;
}

.footer-column h4 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

.footer-column ul { list-style: none; }
.footer-column li { margin-bottom: 0.55rem; }

.footer-column a {
    color: var(--ink);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.25s ease;
}

.footer-column a:hover { color: var(--accent-deep); }

.footer-bottom {
    max-width: var(--max);
    margin: 0 auto;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line);
}

.footer-bottom p {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
}

/* ================= NOTIFICACIÓN ================= */
.notification {
    position: fixed;
    top: 88px;
    right: 20px;
    max-width: 380px;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    color: var(--ink);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10000;
    box-shadow: 0 20px 40px -20px rgba(11, 26, 44, 0.4);
    animation: slideIn 0.35s var(--ease);
}

.notification-error { border-left-color: var(--signal); }

.notification-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ================= REVEAL ================= */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: none;
}

.solution-list li.animate-on-scroll:nth-child(2) { transition-delay: 0.06s; }
.solution-list li.animate-on-scroll:nth-child(3) { transition-delay: 0.12s; }
.solution-list li.animate-on-scroll:nth-child(4) { transition-delay: 0.18s; }
.solution-list li.animate-on-scroll:nth-child(5) { transition-delay: 0.24s; }
.delivery-card.animate-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.delivery-card.animate-on-scroll:nth-child(3) { transition-delay: 0.16s; }
.delivery-card.animate-on-scroll:nth-child(4) { transition-delay: 0.24s; }

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

/* ================= RESPONSIVE ================= */
@media (max-width: 1180px) {
    .nav-links { gap: 1.1rem; }
    .nav-links a { font-size: 0.82rem; }
}

@media (max-width: 1080px) {
    .mobile-menu-btn { display: flex; }

    .nav-links {
        position: fixed;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 1.4rem;
        padding: 0 var(--gutter);
        background: var(--paper);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s ease, visibility 0.35s;
        z-index: 999;
    }

    .nav-links.active { opacity: 1; visibility: visible; }

    .nav-links a {
        font-family: var(--font-display);
        font-size: 2.4rem;
        font-weight: 400;
        color: var(--ink);
    }

    .nav-right { position: relative; z-index: 1001; }

    .delivery-grid { grid-template-columns: repeat(2, 1fr); }
    .delivery-card:nth-child(2) { border-right: 0; }
    .delivery-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }

    .approach-steps { grid-template-columns: repeat(3, 1fr); row-gap: 3rem; }

    .project { grid-template-columns: 4rem 1fr; }
    .project-visual { grid-column: 2; max-width: 460px; }

    .experience-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .sec-head--split { grid-template-columns: 1fr; row-gap: 1.2rem; }

    .solution-block { grid-template-columns: 1fr; }
    .solution-intro { position: static; }
    .solution-kicker { font-size: 4rem; }

    .tech-grid { grid-template-columns: 1fr; }

    .demo-steps { grid-template-columns: 1fr; gap: 1rem; }
    .demo-kpis { grid-template-columns: 1fr 1fr; }
    .kpi:nth-child(2) { border-right: 0; }
    .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
    .navbar { height: 60px; }

    .hero-scroll-container { height: 300vh; }
    .hero-content { padding: 60px 1.25rem 0; }
    .hero-description--sub { display: none; }

    .delivery-grid { grid-template-columns: 1fr; }
    .delivery-card { border-right: 0; border-bottom: 1px solid var(--line); }
    .delivery-card:last-child { border-bottom: 0; }

    .approach-steps { grid-template-columns: 1fr; row-gap: 2.4rem; }
    .approach-step { padding-right: 0; }

    .project { grid-template-columns: 1fr; gap: 1rem; }
    .project-visual { grid-column: auto; }
    .project-num { font-size: 2.6rem; }

    .solution-list li { grid-template-columns: 2.8rem 1fr; }

    .demo-controls { flex-direction: column; align-items: stretch; }
    .console-title { visibility: hidden; }
    .console-body { padding: 1rem; }
    .demo-reading { padding: 1.1rem 1rem; }
    .reading-list p { font-size: 0.9rem; }
    .kpi { padding: 0.9rem 1rem; }
    .demo-slider input[type="range"] { flex: 1; width: auto; }
    .kpi-value { font-size: 1.9rem; }

    .logo-cell { aspect-ratio: 1; }
    .logo-bayer, .logo-fao { height: 64px; }
    .logo-santander { width: 140px; height: 96px; }

    .form-row { grid-template-columns: 1fr; }
    .contact-form { padding: 1.4rem; }

    .footer-content { flex-direction: column; }
}

/* ================= WhatsApp flotante ================= */
.whatsapp-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    box-shadow: 0 10px 24px -8px rgba(11, 26, 44, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.whatsapp-float:hover,
.whatsapp-float:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 14px 28px -8px rgba(11, 26, 44, 0.55);
}
.whatsapp-float:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

@media (max-width: 640px) {
    .whatsapp-float { right: 16px; bottom: 16px; width: 60px; height: 60px; }
    .whatsapp-float svg { width: 32px; height: 32px; }
}
