/* Codexa — hero: seda en movimiento + Dot, el copiloto, con ojos vivos y notificaciones que atiende.
   Las posiciones dentro de Dot (pantalla, pecho, antena) están medidas sobre img/dot.webp (560×1000). */

.hero.hx { display: grid; place-items: stretch; align-items: center; min-height: 100svh; padding: 96px 0 84px; overflow: hidden; isolation: isolate;
  background: radial-gradient(70vmax 50vmax at 75% 40%, rgba(99, 102, 241, .22), transparent 60%), radial-gradient(50vmax 40vmax at 85% 90%, rgba(255, 170, 60, .12), transparent 60%), var(--night); }
.hero.hx::after { display: none; }
.hx-silk { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s ease; }
.hx-silk.on { opacity: .9; }
.hx-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 7, 12, .9) 0%, rgba(7, 7, 12, .66) 34%, rgba(7, 7, 12, .12) 62%, rgba(7, 7, 12, .25) 100%), linear-gradient(180deg, rgba(7, 7, 12, .55) 0%, transparent 22%, transparent 70%, rgba(7, 7, 12, .7) 100%); }

.hx-grid { position: relative; width: 100%; max-width: calc(var(--maxw) + var(--gut) + var(--gut-r)); margin: 0 auto; padding: 0 var(--gut-r) 0 var(--gut);
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(20px, 4vw, 60px); align-items: center;
  opacity: calc(1 - var(--x, 0) * 1.4); transform: translateY(calc(var(--x, 0) * -60px)); }

/* ---------- Texto ---------- */
.hx-copy { display: grid; gap: 22px; justify-items: start; }
.hx-eyebrow { display: inline-flex; align-items: center; gap: 10px; color: #b9bbf5; }
.hx-live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--wa); box-shadow: 0 0 10px var(--wa); }
.hx-live::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--wa); animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.hx-title { display: grid; font: 800 clamp(46px, 6.9vw, 112px)/.9 var(--display); text-transform: uppercase; letter-spacing: -.01em; }
.hx-line { display: block; overflow: hidden; padding-bottom: .06em; }
.hx-l1 { display: inline-block; color: var(--ink); font-variation-settings: "wght" 200, "wdth" 74; transform: translateY(110%);
  transition: transform 1.1s cubic-bezier(.16, 1, .3, 1), font-variation-settings 1.4s cubic-bezier(.16, 1, .3, 1) .35s; }
.hx.go .hx-l1 { transform: none; font-variation-settings: "wght" 820, "wdth" 74; }
.hx-auto { display: flex; align-items: baseline; min-height: 1em; }
.hx-type { color: var(--lamp); font-variation-settings: "wght" 820, "wdth" 74; text-shadow: 0 0 30px rgba(255, 170, 60, .35), 0 0 80px rgba(255, 160, 50, .2); white-space: pre; }
.hx-caret { display: inline-block; width: .08em; height: .78em; margin-left: .05em; border-radius: 2px; background: var(--indigo-hi); box-shadow: 0 0 14px var(--indigo); opacity: 0; transform: translateY(.04em); }
.hx.typing .hx-caret { opacity: 1; }
.hx.typed .hx-caret { animation: caret 1s steps(1) 3 forwards; }
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.hx-lead { max-width: 44ch; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.6; color: #a9aac4; text-wrap: pretty; }
.hx-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hx-proof { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 6px; padding-top: 22px; border-top: 1px solid var(--line); }
.hx-proof li { display: grid; gap: 2px; }
.hx-proof b { font: 800 22px/1 var(--display); font-variation-settings: "wght" 800, "wdth" 80; color: var(--ink); text-transform: uppercase; }
.hx-proof span { font: 400 11.5px/1.3 var(--mono); color: var(--mute); }
.hx-in { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.hx.shown .hx-in { opacity: 1; transform: none; }
.hx.shown .hx-in:nth-of-type(2) { transition-delay: .08s; }
.hx.shown .hx-ctas { transition-delay: .16s; }
.hx.shown .hx-proof { transition-delay: .26s; }
.hx .hx-eyebrow.hx-in { transition-delay: 0s; }
.hx.go .hx-eyebrow { opacity: 1; transform: none; }

/* ---------- Escenario de Dot ---------- */
.hx-stage { position: relative; height: min(76svh, 700px); display: grid; place-items: center; perspective: 1100px; }
.hx-halo { position: absolute; left: 50%; top: 46%; width: 92%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 186, 90, .2) 0%, rgba(99, 102, 241, .22) 38%, transparent 68%); filter: blur(10px); animation: halo 7s ease-in-out infinite alternate; }
@keyframes halo { from { transform: translate(-50%, -50%) scale(.94); opacity: .75; } to { transform: translate(-50%, -50%) scale(1.06); opacity: 1; } }
.hx-orbit { position: absolute; inset: 6% 2% 10%; pointer-events: none; }
.hx-orbit i { position: absolute; left: 50%; top: 50%; width: 96%; aspect-ratio: 2.4; border-radius: 50%; border: 1px solid rgba(129, 140, 248, .22); transform: translate(-50%, -50%) rotate(-14deg); animation: orbit 18s linear infinite; }
.hx-orbit i:nth-child(2) { width: 74%; aspect-ratio: 2; border-color: rgba(255, 196, 107, .18); transform: translate(-50%, -50%) rotate(18deg); animation-duration: 24s; animation-direction: reverse; }
.hx-orbit i::after { content: ""; position: absolute; left: 50%; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--indigo-hi); box-shadow: 0 0 12px var(--indigo-hi); }
.hx-orbit i:nth-child(2)::after { background: var(--lamp); box-shadow: 0 0 12px var(--lamp); }
@keyframes orbit { to { transform: translate(-50%, -50%) rotate(346deg); } }
.hx-orbit i:nth-child(2) { animation-name: orbit2; }
@keyframes orbit2 { from { transform: translate(-50%, -50%) rotate(18deg); } to { transform: translate(-50%, -50%) rotate(378deg); } }

.dot { position: relative; height: 84%; aspect-ratio: 560 / 1000; transform-style: preserve-3d; opacity: 0; transform: translateY(40px) scale(.94); transition: opacity 1.2s var(--ease), transform 1.4s cubic-bezier(.16, 1, .3, 1); }
.hx.go .dot { opacity: 1; transform: none; }
.dot-body { position: absolute; inset: 0; will-change: transform; filter: drop-shadow(0 40px 50px rgba(0, 0, 0, .55)) drop-shadow(0 0 40px rgba(99, 102, 241, .18)); }
.dot-img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.dot-shadow { position: absolute; left: 50%; bottom: -4%; width: 62%; height: 6%; margin-left: -31%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); filter: blur(4px); transform: scale(var(--sh, 1)); }

/* Tapa la cara pintada en la imagen; la cara viva va encima */
.dot-patch { position: absolute; left: 28%; top: 20.5%; width: 46%; height: 15.5%; border-radius: 40%;
  background: radial-gradient(ellipse at 50% 52%, #120f1b 0 52%, rgba(18, 15, 27, .85) 64%, rgba(18, 15, 27, 0) 78%); }
.dot-face { position: absolute; left: 26.8%; top: 17.5%; width: 47.3%; height: 20%; container-type: size; }
.dot-eyes { position: absolute; inset: 0; transition: transform .12s linear; }
.eye { --c: #9ea2ff; position: absolute; top: 34%; width: 13%; height: 34%; border-radius: 50cqw; background: var(--c);
  box-shadow: 0 0 1.4cqw var(--c), 0 0 4.5cqw rgba(99, 102, 241, .9), 0 0 9cqw rgba(99, 102, 241, .45);
  transition: height .18s var(--ease), width .2s var(--ease), top .18s var(--ease), border-radius .2s, background .2s, border-color .2s, transform .12s; }
.eye:first-child { left: 26%; } .eye:last-child { right: 26%; }
.dot-face.blink .eye { height: 4%; top: 49%; }
.dot-mouth { position: absolute; left: 50%; top: 70%; width: 13%; height: 12%; margin-left: -6.5%; border: 1.6cqw solid #9ea2ff; border-top: 0; border-left-color: transparent; border-right-color: transparent;
  border-radius: 0 0 50% 50% / 0 0 100% 100%; filter: drop-shadow(0 0 1.2cqw rgba(99, 102, 241, .9)); transition: all .25s var(--ease); }
.dot-code, .dot-zz { position: absolute; opacity: 0; transition: opacity .25s; }
.dot-code { left: 18%; right: 18%; top: 20%; bottom: 22%; display: grid; gap: 7%; align-content: center; overflow: hidden; }
.dot-code i { height: 7cqh; border-radius: 4cqh; background: linear-gradient(90deg, #9ea2ff 0 40%, transparent 40% 48%, rgba(158, 162, 255, .55) 48% 74%, transparent 74%); box-shadow: 0 0 2cqw rgba(99, 102, 241, .8);
  width: calc(50% + var(--w, 30%)); animation: code .8s linear infinite; }
.dot-code i:nth-child(2) { --w: 10%; animation-delay: -.2s; } .dot-code i:nth-child(3) { --w: 40%; animation-delay: -.45s; } .dot-code i:nth-child(4) { --w: 0%; animation-delay: -.6s; } .dot-code i:nth-child(5) { --w: 25%; animation-delay: -.1s; }
@keyframes code { from { transform: translateY(60%); } to { transform: translateY(-60%); } }
.dot-zz { right: 8%; top: -6%; font: 700 14cqh/1 var(--sans); color: #9ea2ff; text-shadow: 0 0 2cqw #6366f1; }
.dot-zz b { font-size: .7em; vertical-align: super; animation: zz 2s ease-in-out infinite; display: inline-block; }
@keyframes zz { 50% { transform: translateY(-30%); opacity: .5; } }

/* Estados de ánimo */
.dot-face[data-mood="happy"] .eye { height: 26%; top: 34%; background: transparent; border: 2.3cqw solid #9ea2ff; border-bottom: 0; border-radius: 50cqw 50cqw 0 0; box-shadow: 0 -1cqw 3cqw -1cqw rgba(99, 102, 241, .9); }
.dot-face[data-mood="happy"] .dot-mouth { width: 16%; margin-left: -8%; height: 16%; }
.dot-face[data-mood="wow"] .eye { width: 16%; height: 46%; top: 26%; }
.dot-face[data-mood="wow"] .dot-mouth { width: 7%; height: 12%; margin-left: -3.5%; border: 1.4cqw solid #9ea2ff; border-radius: 50%; top: 72%; }
.dot-face[data-mood="work"] .eye, .dot-face[data-mood="sleep"] .eye { height: 5%; top: 62%; }
.dot-face[data-mood="work"] .dot-eyes { transform: none !important; }
.dot-face[data-mood="work"] .dot-code { opacity: 1; }
.dot-face[data-mood="work"] .eye { top: 80%; width: 10%; }
.dot-face[data-mood="work"] .dot-mouth { opacity: 0; }
.dot-face[data-mood="sleep"] .dot-zz { opacity: 1; }
.dot-face[data-mood="sleep"] .dot-mouth { width: 8%; margin-left: -4%; height: 6%; }
.dot-face[data-mood="sleep"] .dot-eyes { transform: none !important; }

.dot-chest { position: absolute; left: 50.4%; top: 52%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 220, 160, .95) 0%, rgba(255, 186, 90, .5) 30%, transparent 68%); opacity: var(--ch, .55); transition: opacity .5s; animation: beat 2.6s ease-in-out infinite; }
@keyframes beat { 50% { transform: translate(-50%, -50%) scale(1.15); } }
.dot-bulb { position: absolute; left: 50.2%; top: 4.1%; width: 9%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 230, 170, 1) 0%, rgba(255, 186, 90, .6) 35%, transparent 70%); opacity: 0; }
.dot.ping .dot-bulb { animation: bulb .9s ease-out; }
@keyframes bulb { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.6); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }

/* ---------- Notificaciones que Dot atiende ---------- */
.hx-notes { position: absolute; inset: 0; pointer-events: none; }
.note { position: absolute; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; column-gap: 10px; width: max-content; max-width: 250px; padding: 10px 14px 10px 10px;
  border-radius: 16px; background: rgba(18, 18, 30, .82); border: 1px solid rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9); opacity: 0; transform: translateY(14px) scale(.9); transition: opacity .45s var(--ease), transform .55s cubic-bezier(.16, 1, .3, 1), border-color .4s, background .4s; }
.note.in { opacity: 1; transform: none; }
.note.out { opacity: 0; transform: translateY(-12px) scale(.96); }
.note .n-ic { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 13px/1 var(--sans); color: #0b0b14; background: var(--c); }
.note b { font: 600 13px/1.25 var(--sans); color: var(--ink); white-space: nowrap; }
.note b small { margin-left: 6px; font: 400 10.5px/1 var(--mono); color: var(--mute); }
.note p { font-size: 12.5px; line-height: 1.35; color: #c7c8dc; }
.note .n-ok { display: none; color: var(--wa); font-weight: 600; }
.note.done { border-color: rgba(37, 211, 102, .45); background: rgba(14, 30, 22, .85); }
.note.done .n-q { display: none; }
.note.done .n-ok { display: block; }
.note::before { content: ""; position: absolute; right: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 10px var(--lamp); transition: opacity .3s; }
.note.done::before { opacity: 0; }
.note[data-pos="0"] { left: -2%; top: 12%; } .note[data-pos="1"] { right: -4%; top: 22%; } .note[data-pos="2"] { left: 0; top: 58%; } .note[data-pos="3"] { right: -2%; top: 66%; }

/* ---------- Intro: la seda se quema y se abre desde el pecho de Dot ---------- */
.intro-cv { position: fixed; inset: 0; z-index: 300; width: 100%; height: 100%; pointer-events: none; }
.intro-mark { position: fixed; left: 50%; top: 50%; z-index: 301; transform: translate(-50%, -50%); pointer-events: none; transition: opacity .5s, transform .8s cubic-bezier(.16, 1, .3, 1); filter: drop-shadow(0 0 30px rgba(99, 102, 241, .7)); }
.intro-mark.out { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }

/* ---------- Celular ---------- */
@media (max-width: 900px) {
  .hero.hx { padding: 84px 0 70px; align-items: start; }
  .hx-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .hx-stage { order: -1; height: 40svh; margin-bottom: -10px; }
  .dot { height: 92%; }
  .hx-copy { justify-items: center; text-align: center; gap: 16px; }
  .hx-title { font-size: clamp(38px, 11.5vw, 64px); justify-items: center; }
  .hx-auto { justify-content: center; }
  .hx-lead { font-size: 15px; }
  .hx-ctas { justify-content: center; }
  .hx-proof { justify-content: center; gap: 8px 18px; padding-top: 14px; }
  .hx-proof b { font-size: 17px; }
  .hx-shade { background: linear-gradient(180deg, rgba(7, 7, 12, .35) 0%, rgba(7, 7, 12, .25) 34%, rgba(7, 7, 12, .82) 52%, rgba(7, 7, 12, .9) 100%); }
  .note { max-width: 190px; padding: 7px 10px 7px 7px; grid-template-columns: 26px minmax(0, 1fr); column-gap: 8px; border-radius: 12px; }
  .note .n-ic { width: 26px; height: 26px; font-size: 11px; }
  .note b { font-size: 11.5px; } .note b small { display: none; } .note p { font-size: 11px; }
  .note[data-pos="0"] { left: 0; top: 6%; } .note[data-pos="1"] { right: 0; top: 18%; } .note[data-pos="2"] { left: 0; top: 56%; } .note[data-pos="3"] { right: 0; top: 64%; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-l1, .hx-in, .dot { transition: none; transform: none; opacity: 1; }
  .hx-orbit i, .hx-halo, .dot-chest { animation: none; }
}

/* El lema escrito puede ocupar dos líneas: sin recorte ni banda del resplandor */
.hx-title { font-size: clamp(44px, 6.3vw, 104px); }
.hx-auto { display: block; overflow: visible; min-height: 1.86em; }
.hx-type { white-space: pre-wrap; text-shadow: 0 0 24px rgba(255, 170, 60, .3); }
.hx-caret { vertical-align: baseline; }
@media (max-width: 900px) { .hx-auto { min-height: 1.86em; } }
@media (max-width: 520px) { .hx-eyebrow { font-size: 9.5px; letter-spacing: .1em; gap: 7px; } }
