/* synlea · inicio: el celular de la portada con Nubia en vivo (.phone-wrap). Lo mantiene la sesión rediseno-12.
   Cuerpo con grosor real (capas en 3D), cristal, isla que se abre y una demo que corre sola (telefono.js). */

@property --sp{syntax:"<number>";inherits:true;initial-value:0}

.phone-wrap{position:absolute;left:0;right:0;margin-inline:auto;top:5%;width:clamp(270px,25vw,370px);z-index:3;
  -webkit-mask-image:linear-gradient(180deg,#000 78%,transparent 95%);mask-image:linear-gradient(180deg,#000 78%,transparent 95%)}
.phone{--r:15.5cqw;--th:.42cqw;position:relative;container-type:inline-size;aspect-ratio:9/19.3;transform-style:preserve-3d;
  transform:perspective(1700px) rotateX(calc(7deg + var(--my,0)*-7deg - var(--sp)*9deg)) rotateY(calc(-17deg + var(--mx,0)*12deg + var(--sp)*19deg)) rotateZ(calc(4deg - var(--sp)*4deg)) translateZ(0) scale(calc(1 - var(--sp)*.05));
  transition:transform .7s cubic-bezier(.2,.8,.2,1)}

/* Grosor: 12 capas del canto, de claro (al frente) a oscuro (atrás) */
.ph-depth,.ph-depth i{position:absolute;inset:0;border-radius:var(--r)}
.ph-depth{transform-style:preserve-3d}
.ph-depth i{background:color-mix(in srgb,#2E333C calc(var(--k)*8%),#D5D9E0);transform:translateZ(calc(var(--k)*var(--th)*-1))}
.ph-depth i:last-child{box-shadow:0 0 0 .2cqw #2B2F37}
.ph-key{position:absolute;right:-.5cqw;width:1.4cqw;border-radius:.6cqw;background:linear-gradient(90deg,#7E8593,#C9CED6);transform:translateZ(calc(var(--th)*-6))}
.ph-key.k1{top:24%;height:11%}.ph-key.k2{top:38%;height:6%}

/* Frente: aro de metal y cristal negro */
.ph-face{position:absolute;inset:0;padding:1.1cqw;border-radius:var(--r);
  background:linear-gradient(128deg,#9AA1AD 0%,#F2F4F7 14%,#AEB4BF 34%,#E9ECF0 56%,#8F96A3 78%,#D7DBE1 100%);
  box-shadow:inset 0 0 0 .25cqw rgba(255,255,255,.7),inset 0 0 0 .7cqw rgba(60,66,78,.25)}
.ph-glass{position:relative;height:100%;padding:2.3cqw;border-radius:calc(var(--r) - 1.1cqw);background:#06070B}
.ph-screen{position:relative;height:100%;overflow:hidden;border-radius:calc(var(--r) - 3.4cqw);padding:2.6cqw 5cqw 0;
  background:radial-gradient(85% 38% at 50% 22%,#E6E1FF 0%,transparent 72%),linear-gradient(180deg,#FBFCFF 0%,#EEF2FA 100%);
  color:#0A0E1C;font-size:4cqw;line-height:1.25;text-align:left;-webkit-font-smoothing:antialiased}
/* Reflejo del cristal que se mueve con el puntero */
.ph-glass::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:5;
  background:linear-gradient(115deg,rgba(255,255,255,0) 30%,rgba(255,255,255,.28) 42%,rgba(255,255,255,0) 54%) calc(50% + var(--mx,0)*60%) 0/220% 100% no-repeat}
.ph-shadow{position:absolute;left:4%;right:-8%;bottom:-7%;height:12%;border-radius:50%;z-index:-1;pointer-events:none;
  background:radial-gradient(closest-side,rgba(20,28,70,.42),transparent);filter:blur(14px);transform:translateX(calc(var(--mx,0)*-26px + 8%))}

/* Barra de estado e isla */
.ph-bar{position:relative;display:flex;align-items:center;justify-content:space-between;height:8.6cqw;padding:0 3cqw;font-size:3.9cqw}
.ph-sig{display:flex;align-items:center;gap:1.4cqw}
.ph-sig>span{display:flex;align-items:end;gap:.6cqw;height:2.8cqw}
.ph-sig>span i{width:.85cqw;border-radius:.3cqw;background:#0A0E1C}
.ph-sig>span i:nth-child(1){height:35%}.ph-sig>span i:nth-child(2){height:55%}.ph-sig>span i:nth-child(3){height:78%}.ph-sig>span i:nth-child(4){height:100%}
.ph-bat{position:relative;width:6cqw;height:3cqw;border-radius:.9cqw;box-shadow:0 0 0 .3cqw rgba(10,14,28,.45);background:linear-gradient(90deg,#0A0E1C 78%,transparent 0)}
.ph-isl{position:absolute;left:50%;top:.8cqw;z-index:4;display:flex;align-items:center;justify-content:center;width:27cqw;height:7.6cqw;border-radius:99px;background:#05060A;color:#fff;
  translate:-50% 0;overflow:hidden;transition:width .6s cubic-bezier(.3,1.4,.4,1),height .6s cubic-bezier(.3,1.4,.4,1)}
.ph-isl>span{display:flex;align-items:center;gap:2cqw;white-space:nowrap;font-size:3.3cqw;font-weight:700;opacity:0;transition:opacity .25s}
.ph-isl>span i{display:grid;place-items:center;width:5.4cqw;height:5.4cqw;border-radius:50%;background:#22C55E;color:#04210F}
.ph-isl .ico{width:3.4cqw;height:3.4cqw}
.ph-isl.open{width:74cqw;height:10cqw}
.ph-bar>b,.ph-sig{transition:opacity .3s}
.ph-bar:has(.open)>b,.ph-bar:has(.open) .ph-sig{opacity:0}
.ph-isl.open>span{opacity:1;transition-delay:.25s}

/* Nubia */
.nb-head{display:flex;align-items:center;gap:2.6cqw;margin-top:4.4cqw}
.nb-head b{font-size:7.4cqw;font-weight:800;letter-spacing:-.03em}
.nb-head small{margin-left:auto;display:flex;align-items:center;gap:1.4cqw;font-size:3.2cqw;font-weight:600;color:#14804A}
.nb-head small::before{content:"";width:1.8cqw;height:1.8cqw;border-radius:50%;background:#22C55E;box-shadow:0 0 0 .8cqw rgba(34,197,94,.18)}
.nb-av{width:8.4cqw;height:8.4cqw;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff 0,#9FB7FF 22%,#1B5EF5 55%,#8B6CF0 100%);box-shadow:0 1.5cqw 3cqw -1cqw rgba(91,71,201,.6)}
.nb-orb{position:relative;width:52cqw;margin:2cqw auto 0}
.nb-orb img{position:relative;z-index:1;width:100%;height:auto}
.nb-orb::before,.nb-orb::after{content:"";position:absolute;inset:14%;border-radius:50%;box-shadow:0 0 0 .4cqw rgba(91,71,201,.25);opacity:0}
.nb-wave{display:flex;justify-content:center;align-items:center;gap:1.1cqw;height:6cqw;margin-top:-1cqw}
.nb-wave i{width:1.1cqw;height:100%;border-radius:1cqw;background:linear-gradient(#1B5EF5,#8B6CF0);transform:scaleY(.18)}
.nb-listen{text-align:center;font-size:3.6cqw;font-weight:600;color:#626A80}
.nb-chat{display:grid;align-content:start;gap:2.2cqw;min-height:30cqw;margin-top:3cqw}
.nb-me{justify-self:end;max-width:86%;padding:2.4cqw 3.8cqw;border-radius:5cqw 5cqw 1.2cqw 5cqw;background:#1B5EF5;color:#fff;font-size:3.7cqw;font-weight:600;box-shadow:0 2cqw 5cqw -2cqw rgba(27,94,245,.7)}
.nb-me.typing::after{content:"";display:inline-block;width:.4cqw;height:3.6cqw;margin-left:.6cqw;background:#fff;vertical-align:-.5cqw;animation:nb-caret .8s steps(2) infinite}
.nb-ai{display:flex;align-items:center;gap:2.4cqw;max-width:88%;padding:2.4cqw 3.4cqw 2.4cqw 2.4cqw;border-radius:5cqw 5cqw 5cqw 1.2cqw;background:#fff;font-size:3.6cqw;line-height:1.22;box-shadow:0 0 0 .3cqw #E3E6EC,0 2cqw 5cqw -3cqw rgba(10,14,28,.25)}
.nb-ai b{font-weight:600}
.nb-ai>span{display:grid;place-items:center;flex:none;width:6.6cqw;height:6.6cqw;border-radius:50%;background:#E8F6EE;color:#14804A}
.nb-ai .ico{width:3.8cqw;height:3.8cqw}
.nb-h{display:block;margin-top:2.6cqw;font-size:5cqw;font-weight:800;letter-spacing:-.025em}
.nb-list{display:grid;gap:2cqw;margin-top:2.4cqw}
.nb-list li{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:2.6cqw;padding:2cqw 2.4cqw;border-radius:4.2cqw;background:#fff;font-size:3.6cqw;font-weight:600;
  box-shadow:0 0 0 .3cqw #E3E6EC,0 2cqw 5cqw -3cqw rgba(10,14,28,.22);transition:box-shadow .4s,transform .5s cubic-bezier(.3,1.5,.4,1)}
.nb-list span{display:grid;place-items:center;width:7.8cqw;height:7.8cqw;border-radius:50%;background:#EAF1FF;color:#1B5EF5}
.nb-list .ico{width:4.2cqw;height:4.2cqw}
.nb-list em{font:700 2.9cqw/1 var(--sans);padding:1.4cqw 2.2cqw;border-radius:99px;background:#E8F6EE;color:#14804A}
.nb-list li.hit{transform:scale(1.035);box-shadow:0 0 0 .5cqw #1B5EF5,0 3cqw 7cqw -3cqw rgba(27,94,245,.55)}
.nb-list li.hit em{background:#1B5EF5;color:#fff}

/* Demo en vivo (solo con JS y sin «reducir movimiento»): estados que pone telefono.js */
@media (prefers-reduced-motion:no-preference){
  .js .stage>.phone-wrap{filter:none}
  .js body.ready .phone{animation:ph-in 1.7s cubic-bezier(.16,1,.3,1) .25s backwards}
  .js body.ready .ph-screen>*{animation:ph-on .9s var(--ease) 1.25s backwards}
  .js .ph-glass::before{content:"";position:absolute;inset:2.3cqw;border-radius:calc(var(--r) - 3.4cqw);background:#06070B;z-index:6;pointer-events:none;opacity:0}
  .js body.ready .ph-glass::before{animation:ph-off 1.2s ease 1s backwards}

  .nb-orb img{animation:nb-breathe 4.5s ease-in-out infinite alternate}
  .live .nb-me,.live .nb-ai{opacity:0;transform:translateY(3cqw) scale(.94);transform-origin:right bottom;transition:opacity .35s,transform .5s cubic-bezier(.3,1.4,.4,1)}
  .live .nb-ai{transform-origin:left bottom}
  .live.has-me .nb-me,.live.has-ai .nb-ai{opacity:1;transform:none}
  .live.is-listen .nb-wave i{animation:nb-wave .9s ease-in-out infinite alternate}
  .live.is-listen .nb-orb::before{animation:nb-ring 1.8s ease-out infinite}
  .live.is-listen .nb-orb::after{animation:nb-ring 1.8s ease-out .9s infinite}
  .live.is-think .nb-orb img{animation:nb-think 1.1s ease-in-out infinite}
  .live.is-think .nb-wave i{animation:nb-dot .7s ease-in-out infinite alternate}
  .live.is-done .nb-orb img{animation:nb-pop .6s cubic-bezier(.3,1.6,.4,1)}
  .nb-wave i:nth-child(2){animation-delay:-.2s!important}.nb-wave i:nth-child(3){animation-delay:-.5s!important}.nb-wave i:nth-child(4){animation-delay:-.1s!important}
  .nb-wave i:nth-child(5){animation-delay:-.6s!important}.nb-wave i:nth-child(6){animation-delay:-.3s!important}.nb-wave i:nth-child(7){animation-delay:-.45s!important}
}
@keyframes ph-in{from{transform:perspective(1700px) translateY(18%) rotateX(32deg) rotateY(-48deg) rotateZ(-8deg) scale(.86)}}
@keyframes ph-on{from{opacity:0;filter:blur(3px)}}
@keyframes ph-off{from{opacity:1}}
@keyframes nb-caret{50%{opacity:0}}
@keyframes nb-breathe{to{transform:scale(1.05) rotate(8deg)}}
@keyframes nb-think{50%{transform:scale(.93) rotate(-10deg);filter:hue-rotate(40deg) saturate(1.3)}}
@keyframes nb-pop{40%{transform:scale(1.1)}}
@keyframes nb-ring{0%{opacity:.9;transform:scale(.9)}100%{opacity:0;transform:scale(1.5)}}
@keyframes nb-wave{0%{transform:scaleY(.2)}100%{transform:scaleY(1)}}
@keyframes nb-dot{0%{transform:scaleY(.2);opacity:.3}100%{transform:scaleY(.2);opacity:1}}

@media (max-width:820px){
  /* El «¿Lo hacemos por ti?» va debajo del teléfono, sin encimarse */
  .phone-wrap{position:relative;top:auto;width:min(68vw,280px);margin-bottom:-24px}
  .phone{transform:perspective(1400px) rotateX(calc(5deg - var(--sp)*5deg)) rotateY(calc(-12deg + var(--sp)*12deg)) rotateZ(calc(3deg - var(--sp)*3deg))}
}
