/* TriPass motion layer: live 3D hero, scroll transitions, touchable surfaces.
   Page content never shrinks or tilts as it scrolls (removed Dec 2026: it broke row lines on phones).
   Loaded after style.css on every page; motion.js drives it. Everything here is decoration on top of a page that
   already works without it: with JavaScript off, or with "reduce motion" on, the page is the plain one. */

/* ===== Scroll progress line ===== */
#tp-scrollline{position:fixed; left:0; top:0; height:2px; width:100%; z-index:60; pointer-events:none;
  background:var(--accent-blue); transform-origin:0 50%; transform:scaleX(var(--sp,0));}

/* ===== Live 3D hero ===== */
/* The encryption stream (app.js) runs behind the 3D scene: entries cross Lock's line and come out as ciphertext. */
.hero.has-3d #leak-canvas{z-index:0;}
.hero3d{position:absolute; top:0; bottom:0; left:54%; width:46%; z-index:1; display:flex; align-items:center; justify-content:center;
  pointer-events:none;}
.h3-stage{position:relative; width:480px; height:440px; perspective:1100px; perspective-origin:50% 42%;
  transform:translateY(var(--h3-drop,0px)) scale(.92); opacity:var(--h3-fade,1); pointer-events:auto;}
.h3-orbit{position:absolute; inset:0; transform-style:preserve-3d;
  transform:rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));}
.h3-orbit > *{position:absolute; left:50%; top:50%;}

/* panes: positioned by --x/--y/--z from the scene centre; lifted by --lift and tilted by --tx/--ty when touched */
.h3-pane{width:var(--w,210px); padding:14px 16px 15px; border:1px solid var(--border2); border-radius:3px;
  background:rgba(255,255,255,.86); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  box-shadow:0 1px 0 #fff inset, 0 22px 44px -18px rgba(17,19,31,.28);
  transform:translate3d(var(--x),var(--y),calc(var(--z) + var(--lift,0px))) rotateX(var(--tx,0deg)) rotateY(var(--ty,0deg));
  transition:transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s; font-family:var(--mono); cursor:default;}
.h3-pane.touching{--lift:34px; transition:transform .12s ease-out, box-shadow .2s;
  box-shadow:0 1px 0 #fff inset, 0 34px 60px -20px rgba(46,75,242,.35);}
.h3-tag{display:block; font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--textf); margin-bottom:8px;}
.h3-pane b{display:block; font-family:var(--head); font-size:17px; color:var(--ink); letter-spacing:-.01em;}
.h3-pane .h3-row{display:flex; justify-content:space-between; gap:10px; font-size:12px; color:var(--text2); margin-top:6px;}
.h3-dots{letter-spacing:.12em; color:var(--ink);}
.h3-chip{display:inline-block; margin-top:10px; font-size:9.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  color:var(--accent-green); border:1px solid currentColor; padding:3px 7px; border-radius:2px;}
.h3-login{--x:-250px; --y:-185px; --z:70px; --w:205px;}
.h3-code{--x:84px; --y:-118px; --z:120px; --w:176px;}
.h3-code .h3-totp{font-family:var(--mono); font-size:30px; font-weight:700; letter-spacing:.04em; color:var(--accent-blue); line-height:1.1;}
.h3-code .h3-timer{display:flex; align-items:center; gap:8px; margin-top:8px; font-size:11px; color:var(--text2);}
.h3-ring{width:18px; height:18px; transform:rotate(-90deg);}
.h3-ring circle{fill:none; stroke-width:3;}
.h3-ring .bg{stroke:var(--border);}
.h3-ring .fg{stroke:var(--accent-blue); stroke-dasharray:44 44; stroke-dashoffset:var(--ring,0); transition:stroke-dashoffset 1s linear;}
.h3-cipher{--x:-150px; --y:96px; --z:-40px; --w:300px; background:rgba(17,19,31,.92); border-color:#11131F; color:#C9D2FF;}
.h3-cipher .h3-tag{color:#8A93C9;}
.h3-ct{display:block; font-size:11.5px; line-height:1.55; word-break:break-all; color:#9FB0FF; min-height:54px;}
.h3-ct .fresh{color:#fff;}

/* Lock sits in the middle of the scene, nearest the viewer */
.h3-core{width:132px; transform:translate3d(-66px,-92px,150px);}
.hero3d .h3-core .hero-mascot{position:relative; top:auto; left:auto; margin:0; width:100%; display:block; z-index:auto;}
/* a dashed orbit around Lock, and a floor grid, give the scene its depth */
.h3-ring3d{width:360px; height:360px; margin:-180px 0 0 -180px; border:1.5px dashed rgba(46,75,242,.45); border-radius:50%;
  transform:translateZ(30px) rotateX(74deg) rotateZ(var(--spin,0deg));}
.h3-ring3d::before{content:""; position:absolute; top:-5px; left:50%; width:9px; height:9px; margin-left:-4px; border-radius:50%; background:var(--accent-blue);}
.h3-floor{width:620px; height:620px; margin:-310px 0 0 -310px;
  background-image:linear-gradient(rgba(46,75,242,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(46,75,242,.16) 1px, transparent 1px);
  background-size:40px 40px; transform:translate3d(0,210px,0) rotateX(90deg);
  -webkit-mask-image:radial-gradient(closest-side, #000 30%, transparent 100%); mask-image:radial-gradient(closest-side, #000 30%, transparent 100%);}
.h3-caption{position:absolute; left:0; right:0; bottom:-6px; text-align:center; font-family:var(--mono); font-size:10.5px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--textf); pointer-events:none;}

@media (max-width:1180px){ .h3-stage{transform:translateY(var(--h3-drop,0px)) scale(.86);} }
@media (max-width:900px){
  .hero.has-3d{padding-bottom:12px; display:flex; flex-direction:column;}
  .hero.has-3d .hero3d{order:2;}
  .hero3d{position:relative; left:auto; width:100%; height:350px; margin-top:8px;}
  .h3-stage{transform:translateY(var(--h3-drop,0px)) scale(.7);}
}
@media (max-width:420px){ .hero3d{height:300px;} .h3-stage{transform:translateY(var(--h3-drop,0px)) scale(.6);} }

/* ===== Scroll transitions ===== */
.sx{translate:0 calc((1 - var(--p,1)) * 28px); opacity:calc(.2 + var(--p,1) * .8);}
.mw{opacity:.16; transition:opacity .35s ease;}
.mw.lit{opacity:1;}

/* ===== Touchable surfaces ===== */
.touch{position:relative; transition:transform .45s cubic-bezier(.16,1,.3,1), box-shadow .3s, background .2s, opacity .55s cubic-bezier(.16,1,.3,1);}
.touch::after{content:""; position:absolute; inset:0; pointer-events:none; opacity:0; transition:opacity .3s;
  background:radial-gradient(260px circle at var(--mx,50%) var(--my,50%), rgba(46,75,242,.10), transparent 60%);}
.touch.touching{z-index:3; transform:perspective(800px) rotateX(var(--tx,0deg)) rotateY(var(--ty,0deg)) translateZ(var(--lift,10px));
  box-shadow:0 22px 44px -22px rgba(17,19,31,.30); transition:transform .14s ease-out, box-shadow .25s;}
.touch.touching::after{opacity:1;}
.touch.pressed{--lift:-6px;}
.btn{transition:transform .15s ease, background .2s, color .2s, border-color .2s;}
.btn:active{transform:scale(.97);}

/* ===== Reduced motion: the plain page ===== */
@media (prefers-reduced-motion: reduce){
  .h3-orbit{transform:rotateX(-6deg) rotateY(-3deg);}
  .h3-stage{transform:none; opacity:1;}
  .sx{translate:none; opacity:1;}
  .mw{opacity:1;}
  .touch.touching{transform:none;}
  .h3-ring .fg{transition:none;}
  #tp-scrollline{display:none;}
}
