/* =========================================================
   INTRO INTERACTIVA — "¿Qué negocio tienes?"
   Todo va dentro de #stage para no chocar con el resto de la web.
   ========================================================= */
@property --a1 { syntax: '<color>'; inherits: true; initial-value: #16224a; }
@property --a2 { syntax: '<color>'; inherits: true; initial-value: #0b2a3f; }

#stage {
  --ease: cubic-bezier(.16, 1, .3, 1);
  --soft: rgba(242, 244, 240, .7);
  --mute: rgba(242, 244, 240, .46);
  --l1: rgba(255, 255, 255, .09);
  --l2: rgba(255, 255, 255, .16);
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  position: relative; min-height: calc(100svh - 72px); display: flex; flex-direction: column;
  isolation: isolate; overflow: hidden; overflow: clip;
  --a1: #16224a; --a2: #0b2a3f;
  transition: --a1 1.8s var(--ease), --a2 1.8s var(--ease);
}
#stage[data-mood=chaos] { --a1: #6a1f1c; --a2: #3a1530; }
#stage[data-mood=calm] { --a1: #1f3a9a; --a2: #0d3a5a; }

#stage .amb { position: absolute; inset: -25%; z-index: -3; filter: blur(120px); opacity: .42; pointer-events: none; }
#stage .amb i { position: absolute; border-radius: 50%; }
#stage .amb i:nth-child(1) { width: 60vmax; height: 60vmax; left: 0; top: 5%; background: var(--a1); animation: ixd1 24s ease-in-out infinite alternate; }
#stage .amb i:nth-child(2) { width: 50vmax; height: 50vmax; right: -5%; top: 25%; background: var(--a2); animation: ixd2 28s ease-in-out infinite alternate; }
#stage .amb i:nth-child(3) { width: 32vmax; height: 32vmax; left: 38%; bottom: 0; background: color-mix(in srgb, var(--a1) 55%, #000); animation: ixd3 20s ease-in-out infinite alternate; }
@keyframes ixd1 { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
@keyframes ixd2 { to { transform: translate(-12vmax, -6vmax) scale(.9); } }
@keyframes ixd3 { to { transform: translate(-8vmax, -12vmax) scale(1.2); } }
#stage .vig { position: absolute; inset: 0; z-index: -2; pointer-events: none; background: radial-gradient(120% 90% at 50% 38%, transparent 35%, rgba(7, 8, 10, .92) 100%); }
#stage .lines { position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--l1) 1px, transparent 1px); background-size: 100% 120px;
  mask-image: radial-gradient(70% 60% at 50% 45%, #000, transparent 85%); -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000, transparent 85%); }

/* actos */
#stage .acts { flex: 1; display: grid; position: relative; z-index: 2; }
#stage .act { grid-area: 1/1; transition: opacity .8s var(--ease), filter .8s var(--ease), transform 1s var(--ease); }
#stage[data-act="2"] .act1 { opacity: 0; filter: blur(14px); transform: scale(.96) translateY(-24px); pointer-events: none; visibility: hidden; position: absolute; inset: 0 0 auto 0; transition: opacity .6s var(--ease), filter .6s var(--ease), transform .8s var(--ease), visibility 0s .8s; }
#stage:not([data-act="2"]) .act2 { opacity: 0; pointer-events: none; visibility: hidden; position: absolute; inset: 0 0 auto 0; }

/* textos */
#stage .ix-eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 12px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
#stage .ix-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-hi); animation: live 1.8s infinite; }
#stage[data-mood=chaos] .ix-eyebrow .dot { background: var(--red); animation: none; }
#stage .h1, #stage .h2 { margin: 0; font-weight: 600; letter-spacing: -.048em; line-height: .98; text-wrap: balance; }
#stage .h1 em, #stage .h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.015em; color: var(--accent-hi); }
#stage .ix-lead { margin: 0; color: var(--soft); font-size: clamp(16.5px, 1.3vw, 19px); line-height: 1.55; text-wrap: pretty; }
#stage .row { display: flex; flex-wrap: wrap; gap: 10px; }
#stage .btn svg { width: 18px; height: 18px; }
#stage .btn-pulse { animation: ixpulse 2.2s infinite; }
@keyframes ixpulse { 0% { box-shadow: 0 0 0 0 rgba(91, 124, 255, .5); } 70% { box-shadow: 0 0 0 14px rgba(91, 124, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(91, 124, 255, 0); } }
#stage .swap { transition: opacity .35s var(--ease), filter .35s var(--ease), transform .35s var(--ease); }
#stage .swap.out { opacity: 0; filter: blur(8px); transform: translateY(6px); }
#stage .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== acto 1 · la pregunta ===== */
#stage .act1 { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 24px; width: 100%; padding: clamp(24px, 6vh, 64px) clamp(16px, 4vw, 48px) clamp(48px, 10vh, 110px); }
#stage .act1 > *:not(.float) { position: relative; z-index: 1; }
#stage .act1 .h1 { font-size: clamp(50px, 7.4vw, 124px); max-width: 12ch; }
#stage .act1 .ix-lead { max-width: 44ch; }
#stage .ask { display: flex; align-items: center; width: min(100%, 600px); height: 68px; padding: 6px 6px 6px 24px; border-radius: 999px;
  background: rgba(14, 15, 17, .78); border: 1px solid var(--l2); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .05); transition: border-color .3s, box-shadow .3s; }
#stage .ask:focus-within { border-color: rgba(91, 124, 255, .55); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9), 0 0 0 5px rgba(91, 124, 255, .12); }
#stage .ask input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font: inherit; font-size: 19px; letter-spacing: -.01em; color: var(--text); }
#stage .ask input::placeholder { color: rgba(242, 244, 240, .38); }
#stage .ask .btn { min-height: 56px; flex: none; }
#stage .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 640px; }
#stage .chip { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--l2); background: rgba(10, 11, 13, .6); color: var(--soft); font: inherit; font-size: 14.5px; cursor: pointer; transition: color .2s, border-color .2s, background-color .2s, transform .2s var(--ease); }
#stage .chip:hover { color: var(--accent-hi); border-color: rgba(91, 124, 255, .4); background: rgba(255, 255, 255, .05); }
#stage .chip:active { transform: scale(.96); }
#stage .fine { font-size: 13px; color: var(--mute); }
#stage .err { min-height: 1.2em; margin: -14px 0 -6px; font-size: 13.5px; color: #ff9a8a; }
#stage .float { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#stage .float .nt { position: absolute; left: 0; top: 0; width: 290px; opacity: 0; filter: blur(1px); animation: ixfl 12s ease-in-out infinite; }
@keyframes ixfl { 0% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 30px)) rotate(var(--r)); } 15%, 80% { opacity: var(--o); } 100% { opacity: 0; transform: translate(var(--x), calc(var(--y) - 40px)) rotate(calc(var(--r) * -1)); } }
#stage .act1.leaving .float .nt { animation: none; opacity: 0; transition: transform .7s cubic-bezier(.6, 0, .3, 1), opacity .7s; }

/* ===== acto 2 · la bandeja ===== */
#stage .act2 { display: flex; flex-direction: column; align-items: center; gap: clamp(18px, 2.6vh, 30px); width: 100%; max-width: 1100px; margin: 0 auto; padding: clamp(20px, 4vh, 40px) clamp(16px, 4vw, 48px) clamp(28px, 5vh, 56px); text-align: center; }
#stage .a2-head { display: flex; flex-direction: column; align-items: center; gap: 16px; }
#stage .h2 { font-size: clamp(40px, 4.8vw, 78px); line-height: 1; letter-spacing: -.046em; max-width: 16ch; }
#stage .h2 .num { font-variant-numeric: tabular-nums; display: inline-block; min-width: 1.2ch; }
#stage .a2-head .ix-lead { max-width: 46ch; text-align: center; }
#stage .a2-head .row { justify-content: center; min-height: 52px; }
#stage .pile { position: relative; width: min(100%, 760px); height: clamp(260px, 36vh, 380px); transition: height .9s var(--ease), opacity .6s; }
#stage .pile.gone { height: 0; opacity: 0; }
#stage .nt { width: min(344px, 86vw); display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; align-items: start; text-align: left; padding: 11px 13px 12px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(44, 46, 51, .97), rgba(30, 32, 36, .97)); border: 1px solid rgba(255, 255, 255, .09); box-shadow: 0 24px 40px -22px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06); }
#stage .pile .nt { position: absolute; left: 50%; top: 50%; will-change: transform; }
#stage .nt .ap { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
#stage .nt .ap svg { width: 21px; height: 21px; }
#stage .ap.wa { background: #25d366; }
#stage .ap.ig { background: linear-gradient(45deg, #f9a33a, #e1306c 50%, #8a3ab9); }
#stage .ap.tel { background: #30d158; }
#stage .ap.mail { background: #0a84ff; }
#stage .ap.rev { background: #fbbc04; color: #3a2a00; }
#stage .nt .mt { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
#stage .nt b { display: block; font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stage .nt b.red { color: #ff7b70; }
#stage .nt p { margin: 1px 0 0; font-size: 14px; line-height: 1.35; color: rgba(242, 244, 240, .82); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#stage .nt .rp { grid-column: 1/-1; display: none; margin-top: 4px; padding: 9px 11px; border-radius: 13px; background: rgba(91, 124, 255, .1); border: 1px solid rgba(91, 124, 255, .3); font-size: 13.5px; line-height: 1.35; color: #e3e9ff; }
#stage .nt .rp small { display: flex; align-items: center; gap: 6px; font: 500 10.5px var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--accent-hi); margin-bottom: 3px; }
#stage .nt .rp small svg { width: 12px; height: 12px; }
#stage .nt.rep .rp { display: block; }
#stage .nt.hot { border-color: rgba(91, 124, 255, .45); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .9), 0 0 0 4px rgba(91, 124, 255, .12); }
#stage .trays { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(100%, 900px); opacity: .38; transition: opacity .8s var(--ease); }
#stage .trays.on { opacity: 1; }
#stage .tray { position: relative; text-align: left; padding: 16px 16px 14px; border-radius: 20px; background: rgba(255, 255, 255, .035); border: 1px solid var(--l1); display: flex; flex-direction: column; gap: 8px; min-width: 0; transition: border-color .4s, background-color .4s; }
#stage .tray.bump { border-color: rgba(91, 124, 255, .4); background: rgba(91, 124, 255, .06); }
#stage .tray-h { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--soft); }
#stage .tray-h i { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); }
#stage .tray-h svg { width: 15px; height: 15px; }
#stage .t-a .tray-h i { background: rgba(91, 124, 255, .16); color: var(--accent-hi); }
#stage .t-r .tray-h i { background: rgba(10, 132, 255, .2); color: #5fb0ff; }
#stage .t-t .tray-h i { background: rgba(255, 214, 10, .16); color: #ffd60a; }
#stage .tray .n { font: 600 clamp(34px, 3.6vw, 46px)/1 var(--font-head); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
#stage .tray .last { font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }
#stage .tray ul { list-style: none; margin: 4px 0 0; padding: 0; display: none; flex-direction: column; }
#stage .trays.done .tray ul { display: flex; }
#stage .trays.done .tray .last { display: none; }
#stage .tray li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--l1); font-size: 13.5px; color: var(--soft); animation: ixbin .5s var(--ease) both; }
#stage .tray li b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
#stage .tray li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#stage .tray li.more { color: var(--mute); }
@keyframes ixbin { from { opacity: 0; transform: translateY(10px); } }

/* medidor de tiempo: a mano vs IA */
#stage .meter { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--l2); background: rgba(10, 11, 13, .7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 14px; color: var(--soft); }
#stage .meter b { font: 600 15px var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
#stage .meter[data-mode=lost] { border-color: rgba(255, 92, 92, .35); }
#stage .meter[data-mode=lost] b { color: #ff8a80; }
#stage .meter[data-mode=ai] { border-color: rgba(91, 124, 255, .4); }
#stage .meter[data-mode=ai] b { color: var(--accent-hi); }
#stage .meter .m-ic { display: grid; place-items: center; }
#stage .meter .m-ic svg { width: 16px; height: 16px; color: var(--accent-hi); }
#stage .meter .m-vs { color: var(--mute); }
#stage .meter .m-vs s { color: #ff8a80; text-decoration-thickness: 2px; }
#stage .meter[data-mode=done] { gap: 0; padding: 0; border-radius: 20px; overflow: hidden; border-color: rgba(91, 124, 255, .3); }
#stage .meter .st { padding: 14px 24px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-right: 1px solid var(--l1); }
#stage .meter .st:last-child { border-right: 0; }
#stage .meter .st span { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
#stage .meter .st b { font: 600 clamp(22px, 2.4vw, 30px) var(--font-head); letter-spacing: -.03em; }
#stage .meter .st b.bad { color: #ff8a80; text-decoration: line-through; text-decoration-thickness: 2px; }
#stage .meter .st b.good { color: var(--accent-hi); }

/* puntos de "escribiendo…" */
#stage .typing { display: inline-flex; gap: 4px; padding: 4px 0; }
#stage .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-hi); animation: ixdot 1s infinite; }
#stage .typing i:nth-child(2) { animation-delay: .15s; }
#stage .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ixdot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* destello al activar la IA */
#stage::after { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: radial-gradient(60% 50% at 50% 40%, rgba(91, 124, 255, .35), transparent 70%); opacity: 0; }
#stage.flash::after { animation: ixflash .7s ease-out; }
@keyframes ixflash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

/* invitación a seguir bajando */
#stage .scroll-cue { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px; color: var(--mute); font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; animation: ixbin .8s .6s var(--ease) both; }
#stage .scroll-cue:hover { color: var(--accent-hi); }
#stage .scroll-cue svg { width: 18px; height: 18px; animation: ixbob 1.6s ease-in-out infinite; }
@keyframes ixbob { 50% { transform: translateY(5px); } }

/* botón de sonido (en la barra de navegación) */
.snd { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); display: grid; place-items: center; color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s; }
.snd:hover { color: var(--accent-hi); border-color: var(--accent-hi); }
.snd svg { width: 18px; height: 18px; }
.snd .off { display: none; }
.snd[aria-pressed=true] .on { display: none; }
.snd[aria-pressed=true] .off { display: block; }

/* responsive */
@media (max-width: 860px) {
  #stage .act1 { justify-content: flex-start; gap: 20px; padding-top: clamp(28px, 7vh, 64px); }
  #stage .act1 .h1 { font-size: clamp(46px, 13vw, 72px); }
  #stage .ask { height: auto; flex-direction: column; align-items: stretch; padding: 6px; border-radius: 24px; gap: 6px; }
  #stage .ask input { flex: none; height: 54px; padding: 0 16px; font-size: 18px; }
  #stage .ask .btn { width: 100%; border-radius: 18px; }
  #stage .float .nt { width: 250px; }
  #stage .trays { gap: 8px; }
  #stage .tray { padding: 12px 10px 10px; border-radius: 16px; gap: 6px; }
  #stage .tray-h { font-size: 12px; flex-direction: column; align-items: flex-start; gap: 6px; }
  #stage .tray .last { display: none; }
  #stage .trays.done { grid-template-columns: minmax(0, 1fr); }
  #stage .trays.done .tray-h { flex-direction: row; align-items: center; }
}
@media (max-width: 640px) {
  .nav .snd { margin-left: auto; }
  .nav .nav-toggle { margin-left: 0; }
  #stage .meter { font-size: 13px; flex-wrap: wrap; justify-content: center; border-radius: 16px; }
  #stage .meter .st { padding: 10px 12px; }
  #stage .meter .st span { font-size: 9.5px; }
}
@media (max-width: 420px) {
  #stage .h2 { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  #stage .amb i, #stage .btn-pulse, #stage .float .nt { animation: none !important; }
}
