/* Effektlar: to'lqin, konfetti, reveal, 3D sahifa kirishi, 3D "ochilgan telefon". (web/js/fx.js bilan) */
:root { --spring: cubic-bezier(.34,1.56,.64,1); --ease: cubic-bezier(.2,.8,.2,1); }

/* To'lqin */
.rpl-host { overflow: hidden; }
.rpl { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .18; transform: scale(0); animation: rpl .62s var(--ease) forwards; z-index: 0; }
@keyframes rpl { to { transform: scale(1); opacity: 0; } }

/* Ko'rinishga kelganda: [data-reveal] (ixtiyoriy: data-reveal="left|scale") */
[data-reveal] { opacity: 0; transform: perspective(900px) translateY(26px) rotateX(10deg); transition: opacity .6s var(--ease), transform .7s var(--spring); transition-delay: var(--d, 0s); }
[data-reveal="left"] { transform: translateX(-26px); } [data-reveal="scale"] { transform: scale(.88); }
[data-reveal].in { opacity: 1; transform: none; }

/* 3D sahifa kirishi (motion.css'dagi .page-enter'ni kuchaytiradi) */
.page-enter { animation-name: pageIn3d !important; animation-duration: .5s !important; animation-timing-function: var(--ease) !important; animation-fill-mode: backwards !important; transform-origin: 50% 0; }
@keyframes pageIn3d { from { opacity: 0; transform: perspective(1200px) translateY(18px) rotateX(7deg) scale(.985); } to { opacity: 1; transform: none; } }
/* Ketma-ket chiqish: 3D egilish bilan */
.stagger > * { animation-name: rise3d !important; animation-duration: .55s !important; animation-timing-function: var(--spring) !important; animation-fill-mode: backwards !important; }
@keyframes rise3d { from { opacity: 0; transform: perspective(800px) translateY(22px) rotateX(14deg) scale(.96); } to { opacity: 1; transform: none; } }

/* Konfetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: conf var(--d) cubic-bezier(.2,.7,.4,1) forwards; }
@keyframes conf { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 420px)) rotate(var(--rot)); opacity: 0; } }

/* Uchuvchi nuqta — savatga */
.fly-dot { background: var(--grad-hot) !important; box-shadow: 0 0 0 5px color-mix(in srgb, var(--solder) 25%, transparent), 0 0 24px var(--solder) !important; }

/* ===== 3D "ochilgan telefon" ===== */
@property --ex { syntax: '<length>'; inherits: true; initial-value: 26px; }
.ph3d { --w: 132px; --h: 268px; position: relative; width: 100%; height: 330px; display: grid; place-items: center; perspective: 1100px; touch-action: pan-y;
  cursor: grab; -webkit-user-select: none; user-select: none; }
.ph3d.dragging { cursor: grabbing; }
.ph-rig { position: relative; width: var(--w); height: var(--h); transform-style: preserve-3d; transform: rotateX(58deg) rotateZ(-32deg); animation: explode 5.5s ease-in-out infinite alternate; }
@keyframes explode { from { --ex: 18px; } to { --ex: 38px; } }
.ph-l { position: absolute; inset: 0; border-radius: 24px; transform-style: preserve-3d; transition: transform .45s var(--spring), filter .3s; display: block; }
.ph-l:nth-child(1) { --i: 0; } .ph-l:nth-child(2) { --i: 1; } .ph-l:nth-child(3) { --i: 2; } .ph-l:nth-child(4) { --i: 3; } .ph-l:nth-child(5) { --i: 4; } .ph-l:nth-child(6) { --i: 5; }
.ph-l { transform: translateZ(calc(var(--i) * var(--ex))); }
.ph-l.hl, .ph-l:hover, .ph-l:focus-visible { transform: translateZ(calc(var(--i) * var(--ex) + 22px)); filter: drop-shadow(0 0 14px color-mix(in srgb, var(--volt) 70%, transparent)); }
.ph-face { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; display: block; }
.ph-tag { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* orqa qopqoq */
.ph-back .ph-face { background: linear-gradient(150deg, #3A3F86, #1A1D4D 60%, #121436); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14), 0 30px 40px -10px rgba(0,0,0,.5); }
.ph-cam { position: absolute; left: 10px; top: 10px; width: 54px; height: 54px; border-radius: 16px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.ph-cam b { position: absolute; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #6C7BFF, #0A0C25 55%); box-shadow: 0 0 0 2.5px #2A2E66; }
.ph-cam b:nth-child(1) { left: 5px; top: 5px; } .ph-cam b:nth-child(2) { left: 29px; top: 17px; } .ph-cam b:nth-child(3) { left: 5px; top: 29px; }
.ph-logo { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; font: 700 15px var(--display); font-style: normal; color: rgba(255,255,255,.35); letter-spacing: .04em; }
/* plata */
.ph-board .ph-face { inset: 10px 12px; border-radius: 16px; background:
  repeating-linear-gradient(90deg, transparent 0 13px, rgba(227,179,65,.32) 13px 14px),
  repeating-linear-gradient(0deg, transparent 0 21px, rgba(227,179,65,.22) 21px 22px), linear-gradient(160deg, #0F4A45, #0A2E2C); box-shadow: inset 0 0 0 1px rgba(227,179,65,.4); }
.ph-chip { position: absolute; background: linear-gradient(145deg, #2A2D3A, #111319); border-radius: 4px; box-shadow: 0 0 0 1px rgba(227,179,65,.55); }
.ph-chip.c1 { left: 18%; top: 14%; width: 46%; height: 18%; } .ph-chip.c2 { left: 22%; top: 42%; width: 26%; height: 13%; } .ph-chip.c3 { left: 56%; top: 46%; width: 22%; height: 9%; }
.ph-trace { position: absolute; left: 30%; bottom: 10%; width: 40%; height: 18%; border: 2px solid rgba(227,179,65,.7); border-top: 0; border-radius: 0 0 10px 10px; }
/* batareya */
.ph-battery .ph-face { inset: 64px 18px 24px; border-radius: 12px; background: linear-gradient(160deg, #24273F, #15172A); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.ph-bat { position: absolute; inset: 10px; border-radius: 8px; background: linear-gradient(180deg, transparent 62%, color-mix(in srgb, #2BE3A4 80%, transparent) 62%); display: grid; place-items: center; }
.ph-bat em { font: 600 10px var(--display); font-style: normal; color: rgba(255,255,255,.7); transform: rotate(-90deg); white-space: nowrap; }
/* ramka */
.ph-frame .ph-face { background: transparent; box-shadow: inset 0 0 0 5px #8D93C9, inset 0 0 0 6px rgba(255,255,255,.5); border-radius: 24px; }
/* ekran */
.ph-screen .ph-face { inset: 5px; border-radius: 20px; background: radial-gradient(80% 50% at 20% 10%, #B26BFF, transparent 70%), radial-gradient(70% 60% at 90% 90%, #FF8240, transparent 70%), linear-gradient(160deg, #3949F5, #1A1D6B); }
.ph-wall { position: absolute; inset: 0; background: radial-gradient(40% 25% at 70% 40%, rgba(43,227,164,.55), transparent 70%); animation: wall 7s ease-in-out infinite alternate; }
@keyframes wall { to { transform: translate(-18%, 22%) scale(1.3); } }
.ph-time { position: absolute; top: 34px; left: 0; right: 0; text-align: center; font: 600 26px var(--display); font-style: normal; color: rgba(255,255,255,.92); letter-spacing: -.02em; }
/* oyna */
.ph-glass .ph-face { background: linear-gradient(150deg, rgba(255,255,255,.22), rgba(255,255,255,.04) 40%, rgba(255,255,255,.1)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.ph-glare { position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.5) 50%, transparent 58%); animation: glare 4.8s ease-in-out infinite; }
@keyframes glare { 0%, 55% { transform: translateX(-45%); } 100% { transform: translateX(45%); } }
.ph-shadow { position: absolute; bottom: 8px; width: 60%; height: 26px; border-radius: 50%; background: radial-gradient(closest-side, rgba(10,12,50,.4), transparent); filter: blur(4px); }
.ph3d.static .ph-rig { animation: none; --ex: 28px; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .ph-rig { animation: none !important; }
}
