/* =====================================================================
   RG Technology v11 — blueprint opening, hero annotations, hero exit
   Loaded AFTER style.css. Nothing in style.css is overridden except
   where noted. All motion states hang off classes on <html>:

     intro   hero is locked + hidden behind the blueprint sequence
     go      hero animations (drift, glows) are running
     rc      hero copy / keys / bubble / nav enter
     anno    annotations + HUD draw in
   ===================================================================== */

/* ---------- opening layer ---------- */
.bp{position:absolute;inset:0;z-index:9;pointer-events:none;display:none}
html.intro .bp{display:block}
#bpc{position:absolute;inset:0;width:100%;height:100%;display:block;pointer-events:auto;background:rgba(3,8,6,.93)}
.bp-skip{position:absolute;right:22px;bottom:20px;z-index:2;pointer-events:auto;padding:7px 16px;border-radius:999px;border:1px solid rgba(205,242,232,.35);background:rgba(3,12,10,.55);color:rgba(205,242,232,.85);font:600 .78rem var(--b);letter-spacing:.02em;opacity:0;transition:opacity .6s,background .2s,color .2s}
.bp-skip.on{opacity:1}.bp-skip:hover{background:var(--lime);color:var(--ink);border-color:var(--lime)}

/* scroll is locked while the sequence plays (Skip / any wheel / key / touch fast-forwards it) */
html.intro{overflow:hidden}

/* hero is dark + still until the paper is cut away */
html.intro:not(.go) #stage *{animation-play-state:paused}
html.intro .hcopy,html.intro .keys,html.intro .bubble,html.intro .scroll{opacity:0}
html.intro .nav{opacity:0;transform:translateY(-100%)}
html.intro.rc .nav{opacity:1;transform:none;transition:opacity .9s ease,transform .9s cubic-bezier(.2,.8,.2,1)}
html.intro.rc .hcopy,html.intro.rc .keys,html.intro.rc .bubble,html.intro.rc .scroll{opacity:1}

/* ---------- hero entrance (only after the reveal) ---------- */
@keyframes rgRise{from{opacity:0;translate:0 22px}to{opacity:1;translate:0 0}}
@keyframes rgKey{from{opacity:0;translate:0 38px}to{opacity:1;translate:0 0}}
@keyframes rgPop{from{opacity:0;scale:.82;translate:0 10px}to{opacity:1;scale:1;translate:0 0}}
html.rc .hcopy>*{animation:rgRise 1s cubic-bezier(.2,.8,.2,1) both}
html.rc .hcopy>*:nth-child(1){animation-delay:.05s}html.rc .hcopy>*:nth-child(2){animation-delay:.18s}
html.rc .hcopy>*:nth-child(3){animation-delay:.34s}html.rc .hcopy>*:nth-child(4){animation-delay:.48s}
html.rc .keys button{animation:rgKey .9s cubic-bezier(.2,.9,.25,1.1) both}
html.rc .keys button:nth-child(1){animation-delay:.55s}html.rc .keys button:nth-child(2){animation-delay:.63s}
html.rc .keys button:nth-child(3){animation-delay:.71s}html.rc .keys button:nth-child(4){animation-delay:.79s}
html.rc .keys button:nth-child(5){animation-delay:.87s}html.rc .keys button:nth-child(6){animation-delay:.95s}
html.rc #hero .bubble{animation:rgPop .8s cubic-bezier(.2,.9,.25,1.2) 1.15s both}
html.rc .scroll{animation:rgRise 1s ease 1.3s both}
/* "Scroll to explore" sits just inside the blueprint frame */
.scroll{left:46px;bottom:36px}

/* ---------- camera: depth without distraction ----------
   JS (intro.js) writes --cs / --cr / --p on #stage:
   a slow dolly-out after the reveal, a faint handheld sway, and a
   scroll-linked push that lets the room fall behind the page. */
#stage{will-change:transform,scale}
.tech{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;opacity:0;will-change:translate;transition:opacity 1.2s ease}
html.anno .tech{opacity:calc(.62 + var(--p,0)*.38)}
.tech path{fill:none;stroke:rgba(205,242,232,.62);stroke-width:1.1;stroke-linecap:round;stroke-linejoin:round}
.tech .g-o{display:none}                       /* object outlines only exist on the paper */
.tech .c{stroke-dasharray:7 3 1.5 3;stroke:rgba(205,242,232,.4)}
.tech .m{stroke:var(--lime);stroke-opacity:.75}
.tech text{font:700 19px var(--hand);fill:rgba(223,247,238,.8);paint-order:stroke;stroke:rgba(5,14,11,.55);stroke-width:3px;text-anchor:middle}
.tech text.l{fill:var(--lime)}
/* annotations draw themselves once, staggered */
.tech .g-d path{stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 1.5s cubic-bezier(.3,.7,.2,1);transition-delay:calc(var(--i,0)*.11s)}
.tech .g-d path.c{stroke-dasharray:7 3 1.5 3;stroke-dashoffset:0;opacity:0;transition:opacity 1s;transition-delay:calc(var(--i,0)*.11s + .4s)}
html.anno .tech .g-d path{stroke-dashoffset:0}
html.anno .tech .g-d path.c{opacity:1}
.tech .g-t text{opacity:0;transition:opacity .9s;transition-delay:calc(var(--i,0)*.11s + .7s)}
html.anno .tech .g-t text{opacity:1}

/* viewport-anchored frame (ticks, registration marks, title block) */
.hud{position:absolute;inset:0;z-index:4;pointer-events:none;width:100%;height:100%;opacity:calc(.9 + var(--p,0)*.1)}
.hud path,.hud circle,.hud line{fill:none;stroke:rgba(205,242,232,.42);stroke-width:1}
.hud .hf{stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 2.2s cubic-bezier(.4,.1,.2,1);stroke-opacity:calc(.5 + var(--p,0)*.5)}
html.anno .hud .hf{stroke-dashoffset:0}
.hud .hk{opacity:0;transition:opacity 1.2s ease .9s}
html.anno .hud .hk{opacity:1}
.hud .hr{stroke:var(--lime);stroke-opacity:.8;transform-box:fill-box;transform-origin:center;scale:.4;opacity:0;transition:scale .9s cubic-bezier(.2,.9,.25,1.4) 1.1s,opacity .5s 1.1s}
html.anno .hud .hr{scale:1;opacity:1}
.hud text{font:500 12px var(--b);fill:rgba(205,242,232,.72);opacity:0;transition:opacity 1s 1.6s}
.hud text.hn{font:700 20px var(--hand);fill:rgba(223,247,238,.9)}
.hud text.hb{font:800 13px var(--h);fill:var(--lime);letter-spacing:.14em}
html.anno .hud text{opacity:1}

/* ---------- hero → services exit ---------- */
.xveil{position:absolute;inset:0;z-index:1;pointer-events:none;background:radial-gradient(120% 90% at 50% 40%,transparent 35%,var(--ink) 100%),var(--ink);opacity:calc(var(--p,0)*.6)}
.hx{position:relative;height:0;z-index:8;pointer-events:none}
.hx svg{position:absolute;left:0;top:0;overflow:visible}
.hx path{fill:none;stroke:url(#hxg);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.hx circle{fill:var(--lime);stroke:var(--em);stroke-width:1.6}
.hx text{font:700 21px var(--hand);fill:var(--em)}

/* the hero's dark world bleeds into Services and is cut away as the page arrives,
   leaving the cream sheet underneath. --cr (0 → 1) is written by intro.js. */
#services::after,#courses::after{content:"";position:absolute;left:0;right:0;top:0;height:80vh;pointer-events:none;z-index:2;
 background:
  linear-gradient(rgba(205,242,232,.07) 1px,transparent 1px) 0 0/48px 48px,
  linear-gradient(90deg,rgba(205,242,232,.07) 1px,transparent 1px) 0 0/48px 48px,
  linear-gradient(180deg,var(--ink) 0,rgba(11,23,18,.9) 34%,rgba(11,23,18,0) 100%);
 -webkit-mask-image:linear-gradient(180deg,#000 0,#000 55%,transparent 100%);mask-image:linear-gradient(180deg,#000 0,#000 55%,transparent 100%);
 opacity:calc(1 - var(--cr,1))}

@media(max-width:860px){.hud text,.tech .g-t{display:none}.scroll{left:34px;bottom:30px}.bp-skip{bottom:14px;right:14px}}
@media(prefers-reduced-motion:reduce){
 html.intro .bp{display:none}
 html.intro{overflow:auto}
 html.intro .hcopy,html.intro .keys,html.intro .bubble,html.intro .scroll{opacity:1}
 html.intro .nav{opacity:1;transform:none}
 .tech,.hud *{transition:none!important}
}
