/* X Architecture — motion layer ("kinetic" theme).
   Everything below is gated by html[data-fx="1"], which motion.js sets on every visit (there is no switch);
   only visitors whose device asks for reduced motion do not get it.
   To go back to the classic look for good: delete this file, motion.js and their two tags in index.html.
   The untouched classic version is also kept on the git branch "classic". */

html[data-fx="1"]{--fxe:cubic-bezier(.16,.84,.3,1)}
html[data-fx="1"] ::selection{background:var(--gold);color:var(--ong)}

/* ---------- scroll progress ---------- */
#fxp{position:fixed;inset:0 0 auto 0;height:2px;z-index:62;pointer-events:none}
#fxp i{display:block;height:100%;background:linear-gradient(90deg,var(--gold),var(--gold2));transform:scaleX(0);transform-origin:0 50%;will-change:transform}
html[dir=rtl] #fxp i{transform-origin:100% 50%}

/* ---------- the pointer is the X Architecture mark ---------- */
html[data-fxcur],html[data-fxcur] *{cursor:none!important}
html[data-fxcur] input,html[data-fxcur] textarea,html[data-fxcur] [contenteditable]{cursor:text!important}
/* the header mark is itself the pointer feedback (it turns into three lines), so the mark-cursor steps aside over it */
html[data-fxcur] #mnb{cursor:pointer!important}
#fxl{position:fixed;left:0;top:0;width:19px;height:24.5px;margin:-12.5px 0 0 -9.5px;z-index:100000;pointer-events:none;opacity:0;transition:opacity .25s;will-change:transform}
#fxl.on{opacity:1}
#fxl.tx{opacity:0}
#fxl svg{width:100%;height:100%;display:block;overflow:visible;transition:transform .5s var(--fxe);filter:drop-shadow(0 0 5px rgba(var(--gr),.5))}
#fxl polygon{stroke:rgba(var(--bgr),.85);stroke-width:26;paint-order:stroke;stroke-linejoin:round}
#fxl polygon:first-child{fill:var(--gold2)}
#fxl polygon:last-child{fill:var(--gold)}
#fxl.hv svg{transform:scale(1.35) rotate(180deg)}
#fxl.dn svg{transform:scale(.74)}
#fxl.hv.dn svg{transform:scale(1.05) rotate(180deg)}
.fxk{position:fixed;left:0;top:0;width:14px;height:14px;margin:-7px 0 0 -7px;border:1px solid var(--gold);border-radius:50%;pointer-events:none;z-index:99999;opacity:0;animation:fxk .75s var(--fxe) forwards}
@keyframes fxk{from{transform:translate(var(--x),var(--y)) scale(.3);opacity:.95}to{transform:translate(var(--x),var(--y)) scale(3.4);opacity:0}}

/* ---------- hero: parametric line ribbons + headline ---------- */
#fxn{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;-webkit-mask-image:linear-gradient(transparent,#000 24%,#000 70%,transparent);mask-image:linear-gradient(transparent,#000 24%,#000 70%,transparent)}
/* the hero mark just breathes: it comes a little closer, then drifts back (no pointer tilt) */
html[data-fx="1"] .mk{will-change:transform;animation:fxz 7s ease-in-out 3.4s infinite}
@keyframes fxz{0%,100%{transform:scale(1)}50%{transform:scale(1.075)}}
html[data-fx="1"].js .hero h1{animation:fxh 1.3s var(--fxe) .25s both}
@keyframes fxh{
from{opacity:0;transform:translateY(.45em) skewY(2.2deg);filter:blur(12px);clip-path:inset(0 0 100% 0)}
55%{filter:blur(0)}
to{opacity:1;transform:none;filter:blur(0);clip-path:inset(-12% -5% -18% -5%)}}
html[data-fx="1"] h1 em{background:linear-gradient(100deg,var(--gold) 0%,var(--gold) 38%,var(--gold2) 50%,var(--gold) 62%,var(--gold) 100%);background-size:260% 100%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent;animation:fxs 6.5s linear 1.8s infinite}
@keyframes fxs{from{background-position:130% 0}to{background-position:-130% 0}}

/* ---------- reveals ---------- */
html[data-fx="1"].js .rv{transform:translateY(56px) scale(.975);filter:blur(6px);transition:opacity 1s var(--fxe) var(--d,0s),transform 1.15s var(--fxe) var(--d,0s),filter .9s ease var(--d,0s)}
html[data-fx="1"].js .rv.in{opacity:1;transform:none;filter:none}
html[data-fx="1"].js .rv[id]{transform:none}

/* section headings: label tracks open, rule draws itself, title is wiped in */
html[data-fx="1"] .hd{border-bottom-color:transparent}
html[data-fx="1"] .hd::after{content:"";position:absolute;inset:auto 0 0 0;height:1px;background:linear-gradient(90deg,var(--gold),var(--line) 55%,transparent);transform:scaleX(1);transform-origin:0 50%;transition:transform 1.6s var(--fxe) .25s}
html[dir=rtl][data-fx="1"] .hd::after{transform-origin:100% 50%;background:linear-gradient(270deg,var(--gold),var(--line) 55%,transparent)}
html[data-fx="1"] .hd.rv:not(.in)::after{transform:scaleX(0)}
html[data-fx="1"] .hd small{transition:letter-spacing 1.7s var(--fxe) .2s}
html[data-fx="1"] .hd.rv:not(.in) small{letter-spacing:.06em}
html[data-fx="1"] .hd h2{justify-self:start;width:fit-content;max-width:100%;clip-path:inset(-14% -3% -14% -3%);transition:clip-path 1.3s var(--fxe) .15s}
html[data-fx="1"] .hd.rv:not(.in) h2{clip-path:inset(-14% 104% -14% -3%)}
html[dir=rtl][data-fx="1"] .hd.rv:not(.in) h2{clip-path:inset(-14% -3% -14% 104%)}

/* ---------- cards: 3D tilt + gold spotlight ---------- */
html[data-fx="1"] [data-fxt]{position:relative;transition:transform .7s var(--fxe),background .3s,box-shadow .6s;will-change:transform}
html[data-fx="1"] [data-fxt].fxh{transition:transform .12s linear,background .3s,box-shadow .6s;z-index:3;box-shadow:0 26px 60px -30px rgba(0,0,0,.7)}
html[data-theme=light][data-fx="1"] [data-fxt].fxh{box-shadow:0 22px 50px -26px rgba(60,48,20,.35)}
html[data-fx="1"] [data-fxt]::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:2;opacity:0;transition:opacity .4s;background:radial-gradient(460px circle at var(--mx,50%) var(--my,50%),rgba(var(--gr),.15),transparent 58%)}
html[data-fx="1"] [data-fxt].fxh::after{opacity:1}
html[data-theme=mono][data-fx="1"] [data-fxt]::after{display:none}
html[data-theme=red][data-fx="1"] [data-fxt]::after{background:radial-gradient(420px circle at var(--mx,50%) var(--my,50%),rgba(180,9,31,.08),transparent 60%)}
html[data-theme=red][data-fx="1"] [data-fxt].fxh{box-shadow:0 22px 50px -26px rgba(20,20,24,.34)}

/* student work: scroll parallax inside the frame */
html[data-fx="1"] .ex img{transform:translate3d(0,var(--py,0px),0) scale(1.15);transition:filter .8s ease,transform .6s cubic-bezier(.2,.7,.2,1)}
html[data-fx="1"] .ex figure:hover img,html[data-fx="1"] .ex figure:focus-visible img{transform:translate3d(0,var(--py,0px),0) scale(1.22)}

/* ---------- buttons: light sweep (magnet is done in JS) ---------- */
html[data-fx="1"] .b.s{position:relative;overflow:hidden}
/* a link styled as a button is inline by default and an inline box does not clip: without this the shine bar sat outside the button */
html[data-fx="1"] :where(a.b.s){display:inline-block}
html[data-fx="1"] .b.s::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(100deg,transparent 32%,rgba(255,255,255,.38) 50%,transparent 68%);transform:translateX(-130%)}
html[data-fx="1"] .b.s:hover::after{transform:translateX(130%);transition:transform .9s var(--fxe)}

/* ---------- header hides on scroll down, returns on scroll up ---------- */
html[data-fx="1"] header{transition:transform .5s var(--fxe),background .3s}
html[data-fx="1"] header.fxu{transform:translateY(-102%)}

/* phones: keep the motion layer quiet */
@media(max-width:700px){
#fxn{display:none}
html[data-fx="1"].js .rv{transform:translateY(20px);filter:none;transition:opacity .7s ease var(--d,0s),transform .8s var(--fxe) var(--d,0s)}
html[data-fx="1"] .hd h2{clip-path:none;transition:none}
html[data-fx="1"] .hd small{transition:none}
html[data-fx="1"] h1 em{animation:none}
}

@media(prefers-reduced-motion:reduce){#fxl,#fxn,#fxp{display:none!important}}
/* the hero loops pause while the hero is scrolled out of view (set by the small observer in index.html) */
html.hoff .mk,html.hoff .mk svg,html.hoff #tp,html.hoff #bt,html.hoff h1 em{animation-play-state:paused!important}
