/* ShoeLab — "Deconstructed": a scroll-driven sneaker assembly.
   Every rule is scoped under #deconstruct so it cannot leak into the
   rest of the page. */

#deconstruct{
  --dc-red:#CC1111;
  --dc-glass:rgba(255,255,255,0.07);
  position:relative;
  /* three screens of scroll drive one screen of animation */
  height:340vh;
  background:#000;
  isolation:isolate;
}
#deconstruct *{box-sizing:border-box;}

/* ── sticky stage ─────────────────────────────────────────────── */
.dc-stage{
  /* one small-viewport tall: the phone's toolbar sliding away never
     changes it, so nothing is re-measured mid-scroll */
  position:sticky; top:0; height:100vh; height:100svh; width:100%;
  overflow:hidden; display:grid; place-items:center;
  contain:layout paint;
  background:
    radial-gradient(120% 90% at 50% 42%, #191919 0%, #0a0a0a 55%, #000 100%);
}

/* a spotlight that blooms as the shoe comes together. Drawn once at full
   strength (soft enough without a blur filter); the script only fades it */
.dc-glow{
  position:absolute; left:50%; top:50%; width:min(120vh,120vw); aspect-ratio:1;
  translate:-50% -50%; pointer-events:none; z-index:0;
  background:radial-gradient(circle,
    rgba(204,17,17,.16) 0%, rgba(204,17,17,.115) 14%, rgba(204,17,17,.075) 26%,
    rgba(204,17,17,.045) 38%, rgba(204,17,17,.02) 50%, rgba(204,17,17,.006) 60%,
    transparent 68%);
  opacity:0; will-change:opacity;
}

/* film grain, very light — keeps the big black areas from banding */
.dc-grain{
  position:absolute; inset:0; z-index:6; pointer-events:none; opacity:.16;
  mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.5'/></svg>");
}

.dc-vignette{
  position:absolute; inset:0; z-index:5; pointer-events:none;
  background:radial-gradient(130% 100% at 50% 50%, transparent 52%, rgba(0,0,0,.72) 100%);
}

/* ── the exploded sneaker ─────────────────────────────────────── */
.dc-shoe{
  position:relative; z-index:2;
  width:min(76vw, 760px);
  height:100%;
  display:block;
}
.dc-layer{
  position:absolute; left:50%; top:50%;
  will-change:transform,opacity;
  transform-origin:50% 50%;
  backface-visibility:hidden;
}
.dc-layer img{
  display:block; width:100%; height:auto;
  /* a contact shadow so parts feel like objects, not cut-outs */
  filter:drop-shadow(0 18px 26px rgba(0,0,0,.62));
}
/* the light sweep that crosses the stack at the moment it locks together */
.dc-sweep{
  position:absolute; inset:0; z-index:3; pointer-events:none; overflow:hidden;
}
.dc-sweep i{
  position:absolute; top:-30%; left:0; width:28%; height:160%;
  background:linear-gradient(100deg, transparent 8%, rgba(255,255,255,.05) 26%,
             rgba(255,255,255,.15) 40%, rgba(255,255,255,.26) 50%,
             rgba(255,255,255,.15) 60%, rgba(255,255,255,.05) 74%, transparent 92%);
  transform:translate3d(-140%,0,0) rotate(9deg); opacity:0;
  will-change:transform,opacity;
}

/* ── liquid glass ─────────────────────────────────────────────── */
.lg{
  position:relative;
  background:linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.035));
  -webkit-backdrop-filter:blur(26px) saturate(200%) brightness(1.08);
  backdrop-filter:blur(26px) saturate(200%) brightness(1.08);
  border-radius:26px;
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,.40),
    inset 0 -1px 0 0 rgba(255,255,255,.07),
    inset 1px 0 0 0 rgba(255,255,255,.10),
    inset -1px 0 0 0 rgba(255,255,255,.10),
    0 24px 70px rgba(0,0,0,.58),
    0 2px 10px rgba(0,0,0,.40);
  overflow:hidden;
}
/* specular bloom that follows the pointer */
.lg::before{
  content:''; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:radial-gradient(62% 86% at var(--mx,50%) var(--my,0%),
    rgba(255,255,255,.22), rgba(255,255,255,0) 62%);
  transition:background .25s ease-out;
}
/* refractive rim — brightest where light would bend hardest */
.lg::after{
  content:''; position:absolute; inset:0; border-radius:inherit; padding:1px;
  pointer-events:none;
  background:linear-gradient(135deg,
    rgba(255,255,255,.55), rgba(255,255,255,0) 34%,
    rgba(255,255,255,0) 64%, rgba(255,255,255,.30));
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
          mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite:exclude;
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .lg{ background:rgba(22,22,24,.86); }
}

/* ── copy ─────────────────────────────────────────────────────── */
.dc-copy{
  position:absolute; z-index:4; left:50%; translate:-50% 0;
  bottom:clamp(1.4rem,5vh,3.2rem);
  width:min(92vw,560px); padding:1.1rem 1.3rem;
  text-align:center; color:#fff;
}
.dc-kicker{
  font-size:.58rem; letter-spacing:.34em; text-transform:uppercase;
  color:var(--dc-red); margin-bottom:.5rem;
}
.dc-title{
  font-family:'Bebas Neue','Arial Black',Impact,sans-serif; font-weight:400;
  font-size:clamp(1.6rem,4.4vw,2.5rem); letter-spacing:.045em; line-height:1;
  margin:0 0 .35rem;
}
.dc-line{
  font-size:.82rem; color:#c9c9c9; line-height:1.55; font-weight:300;
  min-height:2.5em;
}
.dc-swap{display:block; transition:opacity .45s ease, transform .45s ease;}
.dc-swap.out{opacity:0; transform:translateY(8px);}



/* assembly progress rail */
.dc-rail{
  position:absolute; z-index:4; right:clamp(1rem,4vw,2.4rem); top:50%; translate:0 -50%;
  width:3px; height:min(34vh,230px); border-radius:3px;
  background:rgba(255,255,255,.12); overflow:hidden;
}
.dc-rail i{
  position:absolute; left:0; top:0; width:100%; height:100%;
  transform-origin:50% 0; transform:scaleY(0); will-change:transform;
  background:linear-gradient(180deg,#FF2020,var(--dc-red));
  box-shadow:0 0 14px rgba(204,17,17,.75);
}

/* scroll hint, fades out once they start */
.dc-hint{
  position:absolute; z-index:4; left:50%; translate:-50% 0; bottom:1.1rem;
  display:flex; flex-direction:column; align-items:center; gap:.4rem;
  font-size:.56rem; letter-spacing:.28em; text-transform:uppercase; color:#777;
  transition:opacity .4s ease;
}
.dc-hint i{
  width:1px; height:26px;
  background:linear-gradient(180deg,transparent,#CC1111);
  animation:dcDrop 1.9s ease-in-out infinite;
}
@keyframes dcDrop{0%,100%{opacity:.25;transform:scaleY(.55);}50%{opacity:1;transform:scaleY(1);}}

/* shuffle control */

@media(max-width:780px){
  #deconstruct{height:300vh;}
  .dc-shoe{width:84vw;}
  .dc-rail{display:none;}
  /* keep the text clear of the cart and Wesley buttons, which float over
     the bottom corners on every page */
  .dc-copy{bottom:1rem; width:min(96vw,560px); padding:.85rem 5.6rem .85rem 1.3rem; text-align:left;}
  .dc-line{font-size:.76rem;}
  .dc-kicker{font-size:.54rem;}
}

/* On a touch screen the glass is frosted, not live: a live backdrop blur
   re-blurs every part moving behind it, every frame. The grain sits on top
   without a blend mode for the same reason. */
@media (hover:none), (pointer:coarse){
  #deconstruct .lg{
    -webkit-backdrop-filter:none; backdrop-filter:none;
    background:linear-gradient(135deg, rgba(44,44,48,.9), rgba(20,20,22,.9));
  }
  #deconstruct .dc-grain{ mix-blend-mode:normal; opacity:.05; }
}

/* Someone who asked for less motion gets the assembled shoe, no scroll
   choreography and no sweep. */
@media(prefers-reduced-motion:reduce){
  #deconstruct{height:100vh;}
  .dc-hint,.dc-sweep{display:none;}
  .dc-layer{transition:none!important;}
}
