/* Inside the Engineering System — original cinematic narrative.
   True procedural Three.js scene is a progressive enhancement: all copy, links,
   case diagrams and CV remain usable when WebGL/JS or animation is unavailable. */
.cinematic-world{position:relative;isolation:isolate;background:#091724}
.cinematic-backdrop{
  position:sticky;top:0;height:100svh;margin-bottom:-100svh;
  z-index:0;pointer-events:none;overflow:hidden;
  background:radial-gradient(ellipse at 78% 53%,#254a60 0,#0d2133 50%,#071624 93%);
  opacity:0;transition:opacity 1.18s cubic-bezier(.22,1,.36,1);
}
.cinematic-backdrop canvas{
  display:block;width:100%;height:100%;pointer-events:none;
  contain:strict;
  -webkit-mask-image:linear-gradient(90deg,transparent 0%,transparent 34%,#000 55%,#000 100%);
  mask-image:linear-gradient(90deg,transparent 0%,transparent 34%,#000 55%,#000 100%);
}
.cinematic-backdrop:after{
  position:absolute;inset:0;content:"";pointer-events:none;
  background:linear-gradient(90deg,#091724f5 0%,#091724c4 25%,#09172449 46%,transparent 66%);
}
.cinematic-revealed .cinematic-backdrop{opacity:1}
.cinematic-world .hero,.cinematic-world .dev-journey{position:relative;z-index:1}
.cinematic-revealed .hero,.cinematic-revealed .dev-journey{
  background:transparent!important;
}
.cinematic-revealed .hero:before,
.cinematic-revealed .dev-journey:before,
.cinematic-revealed .journey-sticky:before{
  opacity:0!important;
}
.cinematic-ready .hero .hero-network{display:none}
.hero .workbench{opacity:1;transition:opacity 1.08s cubic-bezier(.22,1,.36,1)}
.cinematic-revealed .hero .workbench{
  opacity:0!important;visibility:visible;pointer-events:none;
}
.cinematic-ready .journey-display,
.cinematic-ready .journey-visual-caption{
  opacity:0!important;visibility:hidden;
}
/* Storyboard text is the hero; scene camera is the visual counterpart. */
.cinematic-ready .hero-main{position:relative;z-index:2}
.cinematic-ready .hero-main h1{text-shadow:0 9px 35px #06132164}
.cinematic-ready .journey-narrative{position:relative;z-index:2}
.cinematic-ready .journey-step h2{text-shadow:0 5px 35px #071b2e9c}
.cinematic-ready .journey-step p{color:#d1dfeb}
.cinematic-ready .journey-tech span{background:#0e2947b8;border-color:#8ab9d277}
.cinematic-ready .journey-progress{color:#dce9f0}
.cinematic-ready .journey-visual{pointer-events:none}
.cinematic-ready .hero .profile-card{min-width:0}
/* Distinct engineering case studies: each diagram has a different composition. */
.case-art{isolation:isolate;perspective:900px;overflow:hidden}
.case-art .art-corner{z-index:6}
.case-art:has(.case-demo)>svg{opacity:0;position:absolute;pointer-events:none}
.case-demo{
  position:absolute;z-index:2;inset:0;
  display:flex;align-items:center;justify-content:center;
  transform-style:preserve-3d;
  pointer-events:none;
}
.case-demo *{box-sizing:border-box}
.case-demo__label{
  position:absolute;left:13px;top:10px;
  font:700 9px ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.12em;color:#527891;
}
.case-demo--bank .process-rail{
  position:relative;display:flex;align-items:center;justify-content:space-between;
  width:90%;gap:5px;
}
.case-demo--bank .process-node{
  display:flex;align-items:center;justify-content:center;
  width:28%;height:53px;border-radius:7px;border:1px solid #91adc0;
  background:#fbfdff;color:#254b63;
  box-shadow:0 9px 20px #2b4b5f15,inset 0 1px #fff;
  font:700 10px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;
  transform:rotateY(-9deg) rotateX(5deg);
}
.case-demo--bank .process-node:nth-child(2){
  background:#e2eef3;border-color:#7296ae;
  box-shadow:0 10px 23px #5489a936;
}
.case-demo--bank .process-link{
  height:2px;min-width:10px;flex:1;background:#95b2c6;position:relative;
}
.case-demo--bank .process-link:after{
  content:"";position:absolute;right:-1px;top:-3px;
  border-left:6px solid #678da6;border-top:4px solid transparent;border-bottom:4px solid transparent;
}
.case-demo--bank .process-packet{
  width:10px;height:10px;border-radius:50%;
  position:absolute;left:5%;top:50%;margin-top:-5px;
  background:#477c9a;box-shadow:0 0 0 4px #5799b533,0 0 15px #68aaca99;
  opacity:0;
}
.case-demo--apps .application-stack{
  position:relative;display:flex;align-items:center;justify-content:center;
  width:88%;height:84%;transform:rotateX(14deg) rotateY(-18deg) rotateZ(-3deg);
  transform-style:preserve-3d;
}
.case-demo--apps .application-layer{
  position:absolute;display:flex;justify-content:space-between;align-items:center;
  width:69%;height:57px;padding:10px 14px;
  border-radius:7px;background:#f9fdff;
  border:1px solid #80a6b8;
  box-shadow:9px 12px 19px #28526b22;
  color:#2f5269;
  font:700 11px ui-monospace,SFMono-Regular,Consolas,monospace;
}
.case-demo--apps .application-layer small{font-size:9px;opacity:.65}
.case-demo--apps .application-layer:nth-child(1){transform:translate3d(-44px,-20px,60px);background:#f6fcff}
.case-demo--apps .application-layer:nth-child(2){transform:translate3d(0px,5px,25px);background:#e0edf3}
.case-demo--apps .application-layer:nth-child(3){transform:translate3d(42px,32px,-14px);background:#d6e8ef}
.case-demo--invoice .invoice-surface{
  position:relative;width:76px;height:104px;
  padding:11px 10px;border:1px solid #8caabe;border-radius:5px;
  background:#fafdfd;box-shadow:8px 8px 17px #27486025;
  transform:rotateY(12deg) rotateZ(-4deg) translateX(-47px);
}
.case-demo--invoice .invoice-surface:before{
  content:"";display:block;width:30px;height:6px;border-radius:2px;
  background:#597c95;margin-bottom:17px;
}
.case-demo--invoice .invoice-surface>i{
  display:block;width:90%;height:3px;background:#b4cad7;border-radius:2px;
  margin-bottom:9px;
}
.case-demo--invoice .invoice-surface>i:nth-child(3){width:65%}
.case-demo--invoice .invoice-surface>i:nth-child(4){width:80%}
.case-demo--invoice .invoice-service{
  position:absolute;left:54%;top:34%;
  width:101px;height:52px;display:flex;align-items:center;justify-content:center;
  transform:rotateY(-14deg) rotateX(6deg);
  border:1px solid #8fb4c4;background:#e6f1f5;border-radius:7px;
  color:#31556e;font:700 11px ui-monospace,SFMono-Regular,Consolas,monospace;
  box-shadow:5px 10px 18px #31596c25;
}
.case-demo--invoice .invoice-route{
  position:absolute;left:39%;top:53%;width:16%;height:2px;background:#658ea5;
}
.case-demo--invoice .invoice-route:after{
  content:"";position:absolute;right:0;top:-3px;
  border-left:7px solid #658ea5;border-top:4px solid transparent;border-bottom:4px solid transparent;
}
.case.art-visible .case-demo--bank .process-packet{
  animation:process-packet 3.8s cubic-bezier(.3,.1,.8,1) infinite .3s
}
@keyframes process-packet{
  0%,6%{left:4%;opacity:0}
  12%{opacity:1}
  52%{left:48%;opacity:1}
  88%{left:91%;opacity:1}
  95%,100%{left:91%;opacity:0}
}
.case.art-visible .case-demo--apps .application-stack{
  animation:application-assemble 6s ease-in-out infinite
}
@keyframes application-assemble{
  0%,100%{transform:rotateX(14deg) rotateY(-18deg) rotateZ(-3deg)}
  45%,55%{transform:rotateX(23deg) rotateY(-8deg) rotateZ(2deg)}
}
.case.art-visible .case-demo--invoice .invoice-surface{
  animation:document-forward 5s ease-in-out infinite
}
@keyframes document-forward{
  0%,100%{transform:rotateY(12deg) rotateZ(-4deg) translateX(-47px)}
  50%{transform:rotateY(0) rotateZ(0) translateX(-33px)}
}
@media(min-width:1500px){
  .cinematic-backdrop:after{
    background:linear-gradient(90deg,#091724ee 0%,#091724aa 27%,transparent 63%)
  }
}
@media(max-width:850px){
 .cinematic-backdrop canvas{
   -webkit-mask-image:linear-gradient(180deg,transparent 0%,transparent 44%,#000 79%,#000 100%);
   mask-image:linear-gradient(180deg,transparent 0%,transparent 44%,#000 79%,#000 100%);
 }
 .cinematic-backdrop:after{
   background:linear-gradient(180deg,#071522ed 0%,#071522bf 27%,#07152229 49%,transparent 75%);
 }
 .cinematic-ready .hero-main{
   background:linear-gradient(180deg,#0a1926f0 0%,#0a1926ab 70%,transparent);
   border-radius:12px;
 }
 .cinematic-ready .journey-narrative{
   background:linear-gradient(180deg,#091827d1 0%,#091827a0 76%,transparent);
   border-radius:12px;
 }
}
@media(max-width:600px){
 .cinematic-backdrop:after{
  background:linear-gradient(180deg,#071522eb 0%,#0715228f 35%,transparent 68%);
 }
 .cinematic-ready .hero .profile-card{min-height:220px}
 .cinematic-ready .journey-step h2{font-size:clamp(28px,7vw,38px)}
 .case-demo--bank .process-node{font-size:9px;height:49px}
 .case-demo--apps .application-layer{height:51px}
}
@media(prefers-reduced-motion:reduce){
 .cinematic-backdrop{display:none!important}
 .cinematic-world .hero,.cinematic-world .dev-journey{
  background:inherit!important
 }
 .case-demo .process-packet,
 .case-demo .application-stack,
 .case-demo .invoice-surface{
  animation:none!important;transition:none!important
 }
 .case-demo--bank .process-packet{left:50%;opacity:1}
}
@media print{
 .cinematic-backdrop{display:none!important}
 .cinematic-world{background:#fff!important}
 .case-demo{display:none!important}
 .case-art>svg{opacity:1!important;position:relative!important}
}

/* Mobile: the old rules hid the WebGL canvas even after activation.
   Keep a clean, opaque first paint and crossfade to the same real 3D model. */
@media(max-width:850px){
  .cinematic-backdrop canvas{
    -webkit-mask-image:linear-gradient(180deg,transparent 0%,transparent 12%,#000 44%,#000 100%);
    mask-image:linear-gradient(180deg,transparent 0%,transparent 12%,#000 44%,#000 100%);
  }
  .cinematic-backdrop:after{
    background:linear-gradient(180deg,#071522e9 0%,#071522b9 31%,#0715223c 62%,transparent 86%);
  }
  .cinematic-revealed .cinematic-backdrop canvas{opacity:1!important}
  .cinematic-ready .hero .workbench{visibility:visible!important}
  .cinematic-revealed .hero .workbench{opacity:0!important}
  .cinematic-ready .hero-main{
    background:linear-gradient(180deg,#0a1926d9 0%,#0a19268e 71%,transparent);
    border-radius:12px;
  }
  .cinematic-ready .journey-narrative{
    background:linear-gradient(180deg,#091827d1 0%,#091827a0 76%,transparent);
    border-radius:12px;
  }
}
@media(prefers-reduced-motion:reduce){
  .hero .workbench,.cinematic-backdrop{transition:none!important}
  .cinematic-revealed .hero .workbench{opacity:1!important}
}
