/* ════════════════════════════════════════════════════════════════════
   site.css — Nazca Labs. Tema único oscuro (el video lo es).
   Tokens: entrega_fable/00_LEEME_PRIMERO.md §5. Componentes: componentes.css (PNG/WebP 9-slice).
   Reglas de rendimiento: nada de backdrop-filter / filter / mask-image sobre el video ni sobre capas grandes encima.
   ════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4, p, ul, ol, figure, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
video, canvas, svg, img { display: block; max-width: 100%; }

:root {
  color-scheme: dark;
  --bg: #05060f; --ink: #f4f6ff; --soft: rgba(226,232,255,.8); --mut: #9aa4cf;
  --acc: #4d7cff; --acc2: #9b6bff; --warm: #ff9a4d; --err: #ff6b6b; --eyebrow: #8fb0ff;
  --plate: rgba(12,15,30,.62); --plate-hi: rgba(16,20,40,.84); --edge: rgba(255,255,255,.16);
  --font-h: "General Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-b: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 64px; --gutter: clamp(16px, 4vw, 36px);
  --ease-in: cubic-bezier(.2,.7,.2,1);
}
html { font-size: 16px; background: #000; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-b); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
/* El resplandor de los botones (::after del hover) sobresale ~16 px: recortar el desbordamiento horizontal de las secciones
   para que en móvil no ensanche la página. */
.after, footer { overflow-x: clip; }
body.menu-open { overflow: hidden; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: #fff; color: #05060f; font: 500 .9rem var(--font-h); transition: top .2s; }
.skip:focus { top: 12px; }
#icons { display: none; }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Tipografía */
h1, h2, h3 { font-family: var(--font-h); font-weight: 600; line-height: 1.04; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 3.4vw, 3.5rem); }
.section h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); }
h2.story-title { font-size: clamp(1.9rem, 3.2vw, 2.9rem); }
.dim { display: block; color: rgba(255,255,255,.55); }
.eyebrow, .tag { display: block; font-family: var(--font-h); font-weight: 500; font-size: .8rem; letter-spacing: .17em; text-transform: uppercase; color: var(--eyebrow); }
.lead { color: var(--soft); font-size: clamp(1rem, 1.5vw, 1.16rem); line-height: 1.6; text-wrap: pretty; max-width: 62ch; }
p { text-wrap: pretty; }

/* ══ Barra de progreso (2 px) y barra superior ═══════════════════════ */
#progress { position: fixed; left: 0; top: 0; height: 5px; width: 100%; z-index: 90; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--acc), var(--acc2)); box-shadow: 0 0 10px rgba(120,140,255,.75), 0 0 3px rgba(190,120,255,.9); pointer-events: none; }
.top { position: fixed; left: 0; right: 0; top: 0; z-index: 80; height: calc(var(--nav-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) clamp(18px,3vw,36px) 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-h); }
.top::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,6,15,.78), rgba(5,6,15,0)); pointer-events: none; }
.brand { position: relative; display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 1.1rem; letter-spacing: .02em; min-height: 44px; }
.brand svg { width: 24px; height: 24px; }
.brand .brand-logo { width: 30px; height: 30px; object-fit: contain; margin-right: -5px; }
.top .nav-bar { --k: .68; position: relative; }
.top .nav-bar a { font-size: .9rem; padding: 10px 12px; }
/* Pantallas anchas: menú más alto y centrado en la pantalla (a menos ancho chocaría con los botones de la derecha) */
@media (min-width: 1400px) {
  .top .nav-bar { --k: .8; position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 10px); transform: translateX(-50%); }
  .top .nav-bar a { font-size: .95rem; padding: 12px 14px; }
}
.nav-end { position: relative; display: flex; align-items: center; gap: 10px; }
.nav-end .lang-toggle { --k: .5; }
.nav-end .btn-primary { --k: .68; font-size: .92rem; }
.menu-btn { --k: .5; display: none; }
.menu-btn .ico-close { display: none; }
.menu-btn[aria-expanded="true"] .ico-menu { display: none; }
.menu-btn[aria-expanded="true"] .ico-close { display: block; }

/* Menú móvil (panel de vidrio a pantalla completa) */
#menu { position: fixed; inset: 0; z-index: 75; display: none; padding: calc(var(--nav-h) + env(safe-area-inset-top) + 12px) 16px 24px; background: rgba(5,6,15,.94); }
#menu.is-open { display: flex; flex-direction: column; }
#menu .card-glass { --k: .9; flex: 1; display: flex; flex-direction: column; gap: 8px; }
#menu nav a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 8px 6px; font: 500 1.35rem var(--font-h); color: var(--ink); border-bottom: 1px solid rgba(255,255,255,.08); }
#menu nav a[aria-current] { color: var(--eyebrow); }
#menu nav a .ico { width: 20px; height: 20px; color: var(--eyebrow); }
#menu .menu-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-top: 18px; }
#menu .menu-foot .btn-primary { --k: .78; }
#menu .menu-foot .lang-toggle { --k: .55; }

/* ══ Historia: scroll → video ═════════════════════════════════════════ */
#servicios { position: relative; z-index: 0; }
#scroller { position: relative; }
/* El escenario del video es FIJO durante toda la página: la historia lo controla y luego las secciones pasan por
   encima con la laptop siempre de fondo (solo el pie, opaco, lo tapa). #scroller es el espaciador de la historia. */
#stage { position: fixed; inset: 0; height: 100vh; height: 100svh; overflow: hidden; background: #05060c; }
#dim { position: absolute; inset: 0; pointer-events: none; background: rgba(4,5,14,.62); opacity: 0; }
#vid, #vidrev { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; background: #05060c; }
/* Escritorio: la laptop se desplaza un poco a la derecha para dejar sitio a la tarjeta de texto (--vid-shift ensancha el
   video anclado a la izquierda; se recorta algo de ciudad por la derecha). El chip se recalcula desde este encuadre. */
:root { --vid-shift: 4vw; }
@media (min-width: 861px) { html:not(.is-static) #vid, html:not(.is-static) #vidrev { width: calc(100% + var(--vid-shift)); object-position: 30% 50%; } }
/* Pantallas muy anchas (21:9): el recorte vertical se reparte hacia abajo para no cortar la tarjeta flotante del video */
@media (min-width: 861px) and (min-aspect-ratio: 2/1) { html:not(.is-static) #vid, html:not(.is-static) #vidrev { object-position: 30% 28%; } }
#shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(5,6,15,.78) 0%, rgba(5,6,15,.46) 24%, rgba(5,6,15,0) 44%); }
.story-cards { position: absolute; left: clamp(16px, 2.5vw, 48px); top: 10svh; width: min(37vw, 540px); z-index: 2; }
.story-card { position: absolute; left: 0; top: 0; width: 100%; opacity: 0; visibility: hidden; pointer-events: none; transform-origin: 50% 50%; }
.story-card.is-active { opacity: 1; visibility: visible; pointer-events: auto; will-change: transform, opacity; }
.story-card.is-exiting { pointer-events: none; }
.story-card [data-part] { will-change: transform, opacity; }

/* Hero (reposo 0): sin panel, sobre el degradado */
.story-card--hero { width: min(46vw, 680px); top: 0; }
.story-card--hero .tag { margin-bottom: 18px; }
.story-card--hero .lead { margin-top: 18px; max-width: min(37vw, 540px); }
.story-card--hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.story-card--hero .cta .btn-primary, .story-card--hero .cta .btn-glass { --k: .82; }
.story-card--hero .cta .btn-glass { --k: .72; }
/* Entrada del hero al cargar (transición, no ligada al scroll): html.is-loading → html.is-intro → nada */
html.is-loading .story-card--hero [data-part], html.is-loading .trust, html.is-loading #hint { opacity: 0; transform: translateY(18px); }
html.is-intro .story-card--hero [data-part], html.is-intro .trust, html.is-intro #hint { transition: opacity .75s var(--ease-in), transform .75s var(--ease-in); }
html.is-intro .story-card--hero [data-part="1"] { transition-delay: .08s; }
html.is-intro .story-card--hero [data-part="2"] { transition-delay: .16s; }
html.is-intro .story-card--hero [data-part="3"] { transition-delay: .26s; }
html.is-intro .trust, html.is-intro #hint { transition-delay: .5s; }

/* Tarjetas de servicio: panel de vidrio (PNG) + texto HTML encima */
.story-card--svc { --k: .9; --panel-alpha: .9; display: flex; flex-direction: column; max-height: 58svh; padding: 26px 30px; }
/* Pantallas casi cuadradas (4:3, tablets apaisadas): el video se recorta a los lados y la laptop queda más a la izquierda */
@media (min-width: 861px) and (max-aspect-ratio: 3/2) { .story-cards { width: min(34vw, 460px); } .story-card--hero { width: min(42vw, 560px); } }
.story-card--svc .card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; font-family: var(--font-h); }
.story-card--svc .card-head .tag { margin: 0; }
.story-card--svc .step { font: 500 .9rem var(--font-h); font-variant-numeric: tabular-nums; color: var(--ink); }
.story-card--svc .segs { flex: 1; display: flex; gap: 4px; max-width: 170px; }
.story-card--svc .segs i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.14); }
.story-card--svc .segs i.on { background: linear-gradient(90deg, #35d0ff, var(--acc2)); box-shadow: 0 0 8px rgba(77,124,255,.6); }
.card-body { position: relative; flex: 0 1 auto; min-height: 0; overflow: hidden; }
.card-body.has-overflow { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 28px), transparent 100%); }
.card-scroll { will-change: transform; }
.has-overflow .card-scroll { padding-bottom: 26px; } /* la última línea queda fuera de la máscara al final de la lectura */
.story-card--svc .lead { margin-top: 12px; font-size: clamp(.98rem, 1.3vw, 1.08rem); }
.story-card--svc .bullets { --k: .85; margin-top: 12px; }
.story-card--svc .bullets li { font-size: .98rem; color: #eef1ff; }
.story-card--svc .more { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.story-card--svc .more h3 { font: 500 .78rem var(--font-h); letter-spacing: .16em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 8px; }
.story-card--svc .more p { color: var(--soft); font-size: .95rem; line-height: 1.55; }
.story-card--svc .more ul li { position: relative; padding: 4px 0 4px 16px; font-size: .95rem; color: #e4e9ff; }
.story-card--svc .more ul li::before { content: ""; position: absolute; left: 0; top: .95em; width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg, var(--acc), var(--acc2)); }
.story-card--svc .more + .more { margin-top: 14px; }
.story-card--svc .cta { margin-top: 18px; display: flex; }
.story-card--svc .cta .btn-primary { --k: .78; }
.story-card--svc .card-foot { margin-top: 10px; display: flex; justify-content: flex-end; }
.scroll-cue { display: inline-flex; align-items: center; gap: 6px; font: 500 .74rem var(--font-h); letter-spacing: .12em; text-transform: uppercase; color: var(--mut); opacity: 0; transition: opacity .3s; }
.scroll-cue .ico { width: 14px; height: 14px; }
.has-overflow ~ .card-foot .scroll-cue { opacity: 1; }

/* Fila de servicios (hero) · "Desliza" · puntos laterales · destello del chip */
.trust { position: absolute; left: clamp(16px,2.5vw,48px); right: clamp(16px,2.5vw,48px); bottom: 30px; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; font-family: var(--font-h); font-size: .88rem; color: var(--soft); }
.trust span { display: inline-flex; align-items: center; gap: 8px; }
.trust .ico { width: 18px; height: 18px; color: var(--eyebrow); }
.trust .rule { width: 48px; height: 1px; background: rgba(255,255,255,.35); }
#hint { position: absolute; right: clamp(56px,5vw,80px); bottom: 32px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; font: 500 .8rem var(--font-h); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.75); }
#hint .ico { width: 16px; height: 16px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.dots { position: absolute; right: clamp(8px,1.4vw,22px); top: 50%; transform: translateY(-50%); z-index: 3; display: flex; flex-direction: column; gap: 2px; }
.dots button { --k: .85; display: grid; place-items: center; width: 44px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 999px; }
.dots button .nav-dot { --k: .85; }
#flash { position: absolute; left: 0; top: 0; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; pointer-events: none; opacity: 0; z-index: 2; mix-blend-mode: screen;
  background: radial-gradient(circle, #fff 0%, rgba(205,222,255,.95) 10%, rgba(130,160,255,.7) 26%, rgba(155,107,255,.3) 48%, rgba(155,107,255,0) 70%); }
#dbg { position: fixed; left: 8px; bottom: 8px; z-index: 99; max-width: calc(100vw - 16px); overflow: hidden; font: 12px/1.4 ui-monospace, Consolas, monospace; color: #0f0; background: rgba(0,0,0,.7); padding: 6px 8px; white-space: pre; display: none; }

/* Versión estática (movimiento reducido, video no disponible o elección del usuario) */
html.is-static #scroller { height: auto !important; }
html.is-static #stage { position: relative; height: auto; overflow: visible; }
html.is-static #dim { display: none; }
html.is-static #vid, html.is-static #vidrev { position: relative; width: 100%; height: 100svh; object-position: 50% 50%; }
html.is-static #shade { height: 100svh; }
html.is-static .story-cards { position: static; width: auto; display: block; padding: 0 var(--gutter); }
html.is-static .story-card { position: relative; opacity: 1 !important; visibility: visible !important; transform: none !important; pointer-events: auto; }
html.is-static .story-card [data-part] { opacity: 1 !important; transform: none !important; animation: none !important; }
html.is-static .story-card--hero { position: absolute; left: clamp(16px,2.5vw,48px); top: 12svh; width: min(40vw, 600px); }
html.is-static .svc-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; padding: 56px 0; }
html.is-static .story-card--svc { max-height: none; }
html.is-static .card-body { overflow: visible; }
html.is-static .card-body.has-overflow { -webkit-mask-image: none; mask-image: none; }
html.is-static .card-scroll { transform: none !important; }
html.is-static .dots, html.is-static #hint, html.is-static #flash, html.is-static .scroll-cue { display: none; }
html.is-static .trust { top: calc(100svh - 70px); bottom: auto; }

/* ══ Secciones posteriores ═══════════════════════════════════════════ */
main { position: relative; }
/* Fondo de las secciones posteriores: la laptop encendida (fotograma del video, oscurecido) fija detrás de todo.
   Durante la historia la tapa el escenario del video; después queda bajo las secciones, con un velo oscuro
   para que las tarjetas y el texto se lean (contraste AA). Sin backdrop-filter. */
.after { position: relative; z-index: 1; background: transparent; }
html.is-static .after { background: var(--bg); }
.section { max-width: 1200px; margin: 0 auto; padding: clamp(72px, 10vh, 120px) var(--gutter); }
.section--wide { max-width: 1480px; }
.section .eyebrow { margin-bottom: 14px; }
.section .lead { margin-top: 18px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.grid { display: grid; gap: 20px; margin-top: 44px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { --k: .62; --panel-alpha: 1; display: flex; flex-direction: column; min-width: 0; padding: 28px 26px; transition: transform .35s var(--ease-in); }
.card:hover { transform: translateY(-3px); }
.card .glyph { width: 40px; height: 40px; display: grid; place-items: center; color: var(--eyebrow); margin-bottom: 14px; }
.card h3 { font-size: 1.22rem; margin-bottom: 8px; }
.card p { color: var(--soft); font-size: .96rem; line-height: 1.58; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 14px; }
.tag-pill { --k: .5; font-size: .78rem; color: #dfe5ff; }
.card .more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease-in); }
.card .more > div { overflow: hidden; }
.card .more p { padding-top: 12px; color: #c9d2ff; }
.card.is-open .more { grid-template-rows: 1fr; }
.card .card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-top: auto; padding-top: 16px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--eyebrow); font: 500 .86rem var(--font-h); cursor: pointer; border-radius: 999px; }
.toggle .ico { width: 16px; height: 16px; transition: transform .3s; }
.card.is-open .toggle .ico { transform: rotate(45deg); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--soft); font: 500 .86rem var(--font-h); transition: color .2s; border-radius: 999px; }
.link-arrow:hover { color: #fff; }
.link-arrow .ico { width: 16px; height: 16px; }
.sec-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 40px; }
.sec-cta .btn-primary { --k: .82; }
.sec-cta .note { color: var(--mut); font-size: .92rem; }

/* Proceso */
#proceso .card .step-num { display: block; font: 600 2.2rem/1 var(--font-h); color: rgba(255,255,255,.3); margin-bottom: 14px; transition: color .4s; }
#proceso .card.is-on .step-num { color: var(--acc); }
#proceso .progress { --k: .55; margin-top: 26px; }
#proceso .progress > i { transition: clip-path .8s var(--ease-in); }

/* Nosotros */
#nosotros .about-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.about-grid > *, .contact-grid > *, .f-field, .direct .row > * { min-width: 0; }
#nosotros .points { display: grid; gap: 14px; margin-top: 8px; }
#nosotros .points .card { padding: 20px 22px; }
#nosotros .points h3 { font-size: 1.05rem; }

/* FAQ */
.faq-list { margin-top: 36px; max-width: 820px; }
.faq-item { border-bottom: 1px solid rgba(255,255,255,.1); }
.faq-item:first-child { border-top: 1px solid rgba(255,255,255,.1); }
.faq-q { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 60px; padding: 14px 4px; border: 0; background: none; text-align: left; font: 500 1.08rem var(--font-h); color: var(--ink); cursor: pointer; border-radius: 8px; }
.faq-q .ico { width: 20px; height: 20px; color: var(--eyebrow); transition: transform .3s; }
.faq-q[aria-expanded="true"] .ico { transform: rotate(45deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease-in); }
.faq-a > div { overflow: hidden; }
.faq-a p { padding: 0 4px 18px; color: var(--soft); max-width: 62ch; }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }

/* Contacto */
#contacto .contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px; align-items: start; margin-top: 8px; }
#contacto .proof-line { display: flex; align-items: center; gap: 12px; margin-top: 24px; color: var(--soft); font-size: .95rem; }
#contacto .proof-line .ico { color: var(--eyebrow); }
#contacto .direct { margin-top: 28px; }
#contacto .direct .eyebrow { margin-bottom: 10px; }
#contacto .direct .row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
#contacto .direct a { font: 500 1.05rem var(--font-h); color: var(--ink); word-break: break-all; min-height: 44px; display: inline-flex; align-items: center; }
#contacto .direct .btn-menu { --k: .62; font-size: .86rem; }
.builder { --k: .85; --panel-alpha: .96; padding: 30px 30px 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 22px; border: 0; min-width: 0; }
.chips legend { font: 500 .95rem var(--font-h); margin-bottom: 12px; color: var(--soft); }
.builder .chip { --k: .66; font-size: .86rem; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.f-field { display: grid; gap: 6px; min-width: 0; }
.f-field label { font: 500 .86rem var(--font-h); color: var(--soft); }
.builder .field-wrap { --k: .9; }
.builder .field { --k: .9; }
.f-msg { margin-bottom: 8px; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.f-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 18px; }
.f-foot .btn-primary { --k: .82; }
.f-foot .fine { color: var(--mut); font-size: .86rem; }
#form-status { display: block; margin-top: 12px; font-size: .9rem; color: #b9c4ff; min-height: 1.4em; }
#form-status.is-err { color: var(--err); }
.f-success { display: none; padding: 10px 0; }
.builder.is-done form { display: none; }
.builder.is-done .f-success { display: block; }
.f-success h3 { font-size: 1.6rem; margin-bottom: 8px; }
.f-success p { color: var(--soft); margin-bottom: 18px; }
.f-success .btn-glass { --k: .7; }

/* Pie */
footer { position: relative; z-index: 1; border-top: 1px solid rgba(255,255,255,.1); background: #05060f; color: var(--mut); font-size: .88rem; }
footer .inner { max-width: 1200px; margin: 0 auto; padding: 48px var(--gutter) 28px; }
footer .cols { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 28px; }
footer h4 { font: 500 .78rem var(--font-h); letter-spacing: .16em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 12px; }
footer ul { display: grid; gap: 6px; }
footer ul a, footer button.linklike { display: inline-flex; align-items: center; min-height: 32px; color: var(--soft); transition: color .2s; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
footer ul a:hover, footer button.linklike:hover { color: #fff; }
footer .brand { color: var(--ink); margin-bottom: 10px; }
footer .fine { max-width: 36ch; line-height: 1.5; }
footer .bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
footer .bottom .lang-toggle { --k: .5; }

/* Aparecer al entrar (solo transform/opacity; el contenido está visible en reposo si JS no corre) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-in), transform .7s var(--ease-in); }
.reveal.in, html.no-reveal .reveal { opacity: 1; transform: none; }

/* ══ Responsive ═════════════════════════════════════════════════════ */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .top .nav-bar { display: none; }
  .menu-btn { display: inline-grid; }
  .nav-end .btn-primary { display: none; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #nosotros .about-grid, #contacto .contact-grid { grid-template-columns: minmax(0, 1fr); }
  footer .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 860px) {
  /* Encuadre móvil: el video (16:9) se amplía y se sube para que la laptop con el chip quede en la mitad superior
     y la tarjeta de texto abajo no la tape. object-position 46%: la laptop está algo a la izquierda del centro. */
  html:not(.is-static) #vid, html:not(.is-static) #vidrev { height: 122svh; top: -42svh; object-position: 46% 50%; }
  html.is-static #vid, html.is-static #vidrev { position: relative; object-position: 42% 50%; }
  .story-card--hero .lead { max-width: none; font-size: 1rem; }
  .story-card--hero .tag { margin-bottom: 12px; }
  .story-card--hero .lead { margin-top: 12px; }
  .story-card--hero .cta { margin-top: 18px; gap: 10px; }
  #shade { background: linear-gradient(180deg, rgba(5,6,15,.45) 0%, rgba(5,6,15,.05) 22%, rgba(5,6,15,.08) 50%, rgba(5,6,15,.9) 78%, rgba(5,6,15,.96) 100%); }
  .story-cards { left: 16px; right: 16px; width: auto; top: auto; bottom: 5svh; }
  .story-card { top: auto; bottom: 0; }
  .story-card--hero { width: auto; bottom: 0; }
  .story-card--svc { max-height: 42svh; padding: 20px 20px 18px; }
  .story-card--svc .lead { font-size: .98rem; }
  h1 { font-size: clamp(2rem, 8.2vw, 3rem); }
  h2.story-title { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .dots { right: 2px; top: 31%; } /* por encima de la tarjeta inferior, junto a la laptop */
  .dots button { width: 36px; height: 28px; }
  html.is-static .story-card--hero { position: relative; left: auto; top: auto; width: auto; padding: 24px 0 32px; }
  html.is-static .trust { display: none; }
}
@media (max-width: 640px) {
  .trust { display: none; }
  .g2, .g3, .g4, .f-row { grid-template-columns: minmax(0, 1fr); }
  footer .cols { grid-template-columns: minmax(0, 1fr); }
  .story-card--hero .cta .btn-primary, .story-card--hero .cta .btn-glass { --k: .72; }
  .story-card--svc .bullets li { font-size: .95rem; }
  .builder { padding: 22px 18px 20px; }
  .section { padding-top: 64px; padding-bottom: 64px; }
}
@media (max-width: 400px) {
  .story-card--hero .cta { gap: 8px; }
  .f-foot .btn-primary, .sec-cta .btn-primary { --k: .74; font-size: .95rem; }
  .story-card--svc { max-height: 48svh; padding: 18px 16px 16px; }
  .nav-end { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  #hint .ico { animation: none; }
  html.is-loaded .story-card--hero [data-part] { animation: none; }
  .card:hover { transform: none; }
}

/* ════ 2026-10-14 · tarjetas más grandes, notas intermedias, aro, sonido, iconos 3D ════ */
/* Tarjetas de servicio más amplias en escritorio (siguen a la izquierda, sin tapar la laptop ni el aro) */
@media (min-width: 861px) {
  .story-cards { width: min(39vw, 600px); }
  .story-card--svc, .story-note { max-height: 66svh; padding: 30px 34px; }
  .story-card--svc .story-title, .story-note .story-title { font-size: clamp(1.7rem, 2.5vw, 2.35rem); }
}
@media (min-width: 861px) and (max-aspect-ratio: 3/2) { .story-cards { width: min(37vw, 500px); } }

/* Notas intermedias (quiénes somos / a quién ayudamos): mismo vidrio que las de servicio, sin punto de navegación */
.story-note { --k: .9; --panel-alpha: .9; position: absolute; left: 0; top: 0; width: 100%; display: flex; flex-direction: column; padding: 26px 30px;
  opacity: 0; visibility: hidden; pointer-events: none; transform-origin: 50% 50%; }
.story-note.is-active { opacity: 1; visibility: visible; pointer-events: auto; will-change: transform, opacity; }
.story-note.is-exiting { pointer-events: none; }
.story-note [data-part] { will-change: transform, opacity; }
.story-note .card-head { margin-bottom: 12px; font-family: var(--font-h); }
.story-note .tag { margin: 0; }
.story-note .lead { margin-top: 12px; font-size: clamp(.98rem, 1.3vw, 1.08rem); color: var(--soft); }
.story-note .bullets { --k: .85; margin-top: 14px; }
.story-note .bullets li { font-size: .98rem; color: #eef1ff; }
html.is-static .story-note { position: relative; opacity: 1 !important; visibility: visible !important; transform: none !important; pointer-events: auto; max-width: 1200px; margin: 0 auto 24px; }
html.is-static .story-note [data-part] { opacity: 1 !important; transform: none !important; }
@media (max-width: 860px) {
  .story-note { top: auto; bottom: 0; max-height: none; padding: 18px 20px 14px; }
  .story-note .lead { font-size: .95rem; margin-top: 8px; }
  .story-note .bullets { margin-top: 8px; }
  .story-note .bullets li { font-size: .92rem; padding-top: 4px; padding-bottom: 4px; }
  .story-note .story-title { font-size: 1.45rem; }
}

/* Aro de luz alrededor de la laptop: se enciende cuando el chip se conecta (clase .is-on desde story.js) */
#ring { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; mix-blend-mode: screen; opacity: 0; transition: opacity .5s ease; }
#ring.is-on { opacity: 1; }
#ring ellipse { fill: none; vector-effect: non-scaling-stroke; }
/* brillo breve de toda la línea al conectarse el chip; luego queda apenas más luminosa */
#ring .r-glow { stroke: #9fe3ff; stroke-width: 3; opacity: 0; }
#ring.is-on .r-glow { animation: ring-glow 1.8s ease-out forwards; }
@keyframes ring-glow { 0% { opacity: 0; } 18% { opacity: .75; } 100% { opacity: .16; } }
/* barrido de luz: 5 trazos superpuestos del mismo largo creciente = cabeza brillante con cola que se desvanece */
#ring .r-comet ellipse { stroke: #d6f4ff; stroke-width: 3; stroke-linecap: round; opacity: .22; stroke-dashoffset: 100; }
#ring .r-comet { opacity: 0; transition: opacity .6s ease; }
#ring.is-on .r-comet { opacity: 1; transition-delay: .5s; }
#ring.is-on .r-comet ellipse { animation: ring-sweep 4.8s linear infinite; }
@keyframes ring-sweep { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
html.is-static #ring { display: none; }
@media (prefers-reduced-motion: reduce) { #ring.is-on .r-comet ellipse { animation: none; } #ring.is-on .r-glow { animation: none; opacity: .3; } }

/* Sonido: botón redondo en la barra + enlace bajo los botones del hero */
.sound-btn { --k: .46; }
.sound-btn .ico-sound { width: 22px; height: 22px; }
.ico-sound .x { display: inline; } .ico-sound .w1, .ico-sound .w2 { display: none; }
.is-on > .ico-sound .x { display: none; } .is-on > .ico-sound .w1, .is-on > .ico-sound .w2 { display: inline; }
.sound-row { margin-top: 18px; }
.sound-hint { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  color: var(--soft); font: 500 .92rem var(--font-h); letter-spacing: .02em; }
.sound-hint .ico-sound { width: 20px; height: 20px; color: var(--eyebrow); }
.sound-hint:hover { color: #fff; }
.sound-hint.is-on { color: #fff; }
.sound-hint:focus-visible, .sound-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 999px; }
@media (max-width: 640px) { .sound-btn { display: none; } }

/* Iconos 3D en las tarjetas de resumen y trabajos */
.card .glyph--3d { width: 88px; height: 88px; margin: -6px 0 12px -8px; }
.card .glyph--3d .icon3d { width: 88px; height: 88px; filter: drop-shadow(0 10px 22px rgba(77,124,255,.28)); transition: transform .35s var(--ease-in); }
.card:hover .glyph--3d .icon3d { transform: translateY(-3px) scale(1.04); }
.svc-grid { gap: 24px; }
.svc-grid .card { padding: 30px 30px 26px; }
.svc-grid .card h3 { font-size: 1.32rem; }
.svc-grid .card .tags { gap: 8px 10px; }
.card--cta { justify-content: flex-start; text-align: left; }
.card--cta h3 { font-size: 1.5rem; }
.card--cta .card-actions { justify-content: flex-start; }
.card--cta .btn-primary { --k: .74; }
@media (prefers-reduced-motion: reduce) { .card:hover .glyph--3d .icon3d { transform: none; } }

/* Números 3D del proceso */
#proceso .card .step-num { width: 96px; height: 72px; margin-bottom: 10px; }
#proceso .card .step-num img { width: 96px; height: 72px; object-fit: contain; opacity: .5; filter: saturate(.6); transition: opacity .4s, filter .4s; }
#proceso .card.is-on .step-num img { opacity: 1; filter: none; }
/* Campos: el foco lo marca la pieza campo-foco (borde neón, contraste alto); sin el rectángulo blanco genérico encima */
.field:focus-visible { outline: 0; }
@media (forced-colors: active) { .field:focus-visible { outline: 2px solid CanvasText; } }

/* Botones principales algo más grandes y visibles (hero y barra) */
.story-card--hero .cta .btn-primary { --k: .9; font-size: 1.05rem; }
.story-card--hero .cta .btn-glass { --k: .8; font-size: 1.05rem; }
.nav-end .btn-primary { --k: .72; }
@media (max-width: 640px) { .story-card--hero .cta .btn-primary, .story-card--hero .cta .btn-glass { --k: .74; font-size: .98rem; } }
@media (max-width: 400px), (max-height: 700px) and (max-width: 860px) { .story-note .lead { display: none; } }

/* Estado del sonido bien visible: apagado = atenuado y tachado; encendido = halo cian + ondas animadas */
.sound-btn { position: relative; }
.sound-btn:not(.is-on) .ico-sound { opacity: .6; }
.sound-btn.is-on { filter: brightness(1.25) saturate(1.2); }
.sound-btn.is-on::after { content: ""; position: absolute; inset: 9%; border-radius: 50%; box-shadow: 0 0 0 2px rgba(94,224,255,.85), 0 0 18px 4px rgba(94,224,255,.55); pointer-events: none; }
.is-on > .ico-sound .w1 { animation: snd-wave 1.2s ease-in-out infinite; }
.is-on > .ico-sound .w2 { animation: snd-wave 1.2s ease-in-out .2s infinite; }
@keyframes snd-wave { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.sound-hint.is-on .ico-sound { color: #5ee0ff; filter: drop-shadow(0 0 6px rgba(94,224,255,.8)); }
.sound-toast { position: fixed; z-index: 120; top: calc(var(--nav-h) + 10px + env(safe-area-inset-top)); right: clamp(18px, 3vw, 36px);
  padding: 9px 16px; border-radius: 999px; background: rgba(12,16,40,.92); border: 1px solid rgba(94,224,255,.55); box-shadow: 0 0 18px rgba(77,124,255,.45);
  color: #fff; font: 500 .9rem var(--font-h); opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; pointer-events: none; }
.sound-toast.is-show { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .is-on > .ico-sound .w1, .is-on > .ico-sound .w2 { animation: none; } .sound-toast { transition: none; } }
/* Puntos de navegación más grandes y fáciles de tocar */
.dots { gap: 4px; }
.dots button { width: 48px; height: 40px; }
.dots button .nav-dot { --k: 1.2; }
@media (max-width: 860px) { .dots button { width: 40px; height: 32px; } .dots button .nav-dot { --k: 1; } }
#proceso .card .step-num img { object-position: left center; }

/* "Desliza" / "Sigue deslizando": píldora visible durante toda la historia (antes desaparecía con el hero) */
#hint { bottom: 22px; padding: 9px 16px 9px 18px; border-radius: 999px; z-index: 4;
  background: rgba(8,12,32,.62); border: 1px solid rgba(94,224,255,.45); box-shadow: 0 0 16px rgba(77,124,255,.35); color: #fff; letter-spacing: .12em; pointer-events: none; transition: opacity .3s; }
#hint .ico { color: #5ee0ff; }
#hint.is-more { border-color: rgba(155,107,255,.55); }
@media (max-width: 860px) { #hint { display: inline-flex; right: auto; left: 50%; transform: translateX(-50%); bottom: 8px; padding: 6px 12px; font-size: .7rem; } html.is-loading #hint { transform: translate(-50%, 18px); } }
@media (prefers-reduced-motion: reduce) { #hint { transition: none; } }
.story-card--svc .card-foot { display: none; } /* el indicador global "Sigue deslizando" ya cumple esa función */

/* Reproducción automática hero → Agentes: el indicador muestra "Reproduciendo…" con barra de avance */
#hint::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; border-radius: 2px; transform-origin: left center;
  transform: scaleX(var(--auto-p, 0)); background: linear-gradient(90deg, #5ee0ff, var(--acc2)); opacity: 0; transition: opacity .3s; }
html.is-auto #hint::after { opacity: 1; }
html.is-auto #hint .ico { animation: none; opacity: .4; }

/* "Chip vivo": bucle de la pantalla+chip en los reposos, fundido con el video (bordes difuminados) */
/* v7: chip limpio + partículas en los reposos (story.js chipFx) */
.chipfx { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; max-width: none; max-height: none; opacity: 0; transition: opacity .12s ease; }

.chipfx.is-on { opacity: 1; transition-duration: .45s; }
html.is-static .chipfx { display: none; }
@media (prefers-reduced-motion: reduce) { #chipfx { display: none; } }
.vida { position: absolute; left: 0; top: 0; max-width: none; max-height: none; z-index: 0; pointer-events: none; object-fit: fill; opacity: 0; transition: opacity .6s ease;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); }
.vida.is-on { opacity: 1; }
.vida.is-fast { transition-duration: .15s; }
.vida--tarjeta { -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%); }
html.is-static .vida { display: none; }
@media (prefers-reduced-motion: reduce) { .vida { display: none; } }

/* Retroceso automático: tramo invertido reproducido de verdad encima de #vid (mismo encuadre) */
#vidrev { opacity: 0; pointer-events: none; }
#vidrev.is-on { opacity: 1; }
html.is-static #vidrev { display: none; }

/* Indicador de deslizar con ratón (piezas de ChatGPT: raton.webp, raton-rueda.webp, raton-flecha.webp, 2026-10-15):
   la rueda baja dentro de la ranura y las dos flechas se encienden en cascada hacia abajo */
#hint { gap: 12px; padding: 8px 18px 8px 12px; }
#hint .mouse { position: relative; flex: none; width: 22px; height: 39px; background: url(../componentes/raton.webp) center / contain no-repeat; }
#hint .mouse .wheel { position: absolute; left: 50%; top: 16%; width: 7px; height: 12.5px; margin-left: -3.5px;
  background: url(../componentes/raton-rueda.webp) center / contain no-repeat; animation: hint-wheel 1.6s cubic-bezier(.45,0,.55,1) infinite; }
#hint .chev { display: flex; flex-direction: column; align-items: center; gap: 0; margin-left: 2px; }
#hint .chev i { display: block; width: 14px; height: 9.5px; background: url(../componentes/raton-flecha.webp) center / contain no-repeat; opacity: .25; animation: hint-chev 1.6s ease-in-out infinite; }
#hint .chev i + i { margin-top: -2px; animation-delay: .2s; }
@keyframes hint-wheel { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 70% { transform: translateY(9px); opacity: 1; } 100% { transform: translateY(11px); opacity: 0; } }
@keyframes hint-chev { 0%, 100% { opacity: .2; transform: translateY(-2px); } 45% { opacity: 1; transform: translateY(1px); } }
html.is-auto #hint .mouse .wheel { animation-duration: .9s; }
html.is-auto #hint .chev i { animation-duration: .9s; }
@media (max-width: 860px) { #hint { gap: 9px; padding: 5px 12px 5px 9px; } #hint .mouse { width: 16px; height: 28px; } #hint .mouse .wheel { width: 5px; height: 9px; margin-left: -2.5px; }
  @keyframes hint-wheel { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 70% { transform: translateY(6px); opacity: 1; } 100% { transform: translateY(8px); opacity: 0; } } #hint .chev i { width: 11px; height: 7.5px; } }
@media (prefers-reduced-motion: reduce) { #hint .mouse .wheel, #hint .chev i { animation: none; opacity: 1; } }
#hint { white-space: nowrap; }
