-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
1 lines (1 loc) · 87.6 KB
/
Copy pathscript.js
File metadata and controls
1 lines (1 loc) · 87.6 KB
1
window.__SENTRY_DSN__="https://1db90a8daa20c20cbf2d937d9194a4d2@o4511632499343360.ingest.de.sentry.io/4511640996806736","undefined"!=typeof Sentry&&Sentry.init({dsn:window.__SENTRY_DSN__});const page=document.body.dataset.page,navLink=document.querySelector(`[data-nav="${page}"]`);navLink&&(navLink.classList.add("active"),navLink.setAttribute("aria-current","page"));const scrollProgressBar=document.querySelector(".scroll-progress-bar");let scrollProgressTicking=!1;const backToTopBtn=document.getElementById("back-to-top");let backToTopTicking=!1;function getAge(){const e=new Date("2009-07-07"),t=new Date;let n=t.getFullYear()-e.getFullYear();const o=t.getMonth()-e.getMonth();return(o<0||0===o&&t.getDate()<e.getDate())&&n--,n}function updateScrollProgress(){if(!scrollProgressBar)return;const e=document.documentElement,t=e.scrollTop||document.body.scrollTop||0,n=e.scrollHeight-e.clientHeight,o=n>0?t/n*100:0;e.style.setProperty("--scroll-progress",`${o}%`),scrollProgressTicking=!1}function requestScrollProgressUpdate(){scrollProgressBar&&!scrollProgressTicking&&(scrollProgressTicking=!0,requestAnimationFrame(updateScrollProgress))}function updateBackToTop(){if(!backToTopBtn)return;const e=(window.scrollY||document.documentElement.scrollTop||0)>520;backToTopBtn.classList.toggle("show",e),backToTopTicking=!1}function requestBackToTopUpdate(){backToTopBtn&&!backToTopTicking&&(backToTopTicking=!0,requestAnimationFrame(updateBackToTop))}scrollProgressBar&&(updateScrollProgress(),window.addEventListener("scroll",requestScrollProgressUpdate,{passive:!0}),window.addEventListener("resize",updateScrollProgress)),backToTopBtn&&(updateBackToTop(),window.addEventListener("scroll",requestBackToTopUpdate,{passive:!0}),window.addEventListener("resize",updateBackToTop),backToTopBtn.addEventListener("click",()=>{window.scrollTo({top:0,behavior:prefersReducedMotion?"auto":"smooth"})}));const sectionRailLinks=Array.from(document.querySelectorAll(".section-rail a[data-section]")),sectionRail=document.querySelector(".section-rail"),railSections=sectionRailLinks.map(e=>{const t=e.dataset.section,n=t?document.getElementById(t):null;return n?{id:t,link:e,section:n}:null}).filter(Boolean);let activeRailId=null;function setActiveRail(e){e&&e!==activeRailId&&(activeRailId=e,railSections.forEach(({id:t,link:n})=>{const o=t===e;n.classList.toggle("active",o),o?n.setAttribute("aria-current","true"):n.removeAttribute("aria-current")}))}if(railSections.length){setActiveRail(railSections[0].id);const e=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&setActiveRail(e.target.id)})},{rootMargin:"-45% 0px -45% 0px",threshold:.01});if(railSections.forEach(({section:t})=>e.observe(t)),window.location.hash){const e=window.location.hash.replace("#","");railSections.some(({id:t})=>t===e)&&setActiveRail(e)}window.addEventListener("hashchange",()=>{const e=window.location.hash.replace("#","");railSections.some(({id:t})=>t===e)&&setActiveRail(e)})}const prefersReducedMotion=window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches||!1,revealTargets=new Set([...document.querySelectorAll(".reveal")]);prefersReducedMotion||document.querySelectorAll(".tilt-zone").forEach(e=>{e.querySelectorAll(".tilt").forEach((e,t)=>{e.classList.contains("reveal")||(e.classList.add("reveal","reveal-child"),e.style.setProperty("--reveal-delay",`${Math.min(45*t,240)}ms`),revealTargets.add(e))})});const revealElements=[...revealTargets];if(prefersReducedMotion)revealElements.forEach(e=>e.classList.add("show"));else{let e=0;revealElements.forEach(t=>{Array.from(t.classList).some(e=>e.startsWith("delay-"))||t.style.getPropertyValue("--reveal-delay")||(t.style.setProperty("--reveal-delay",`${Math.min(40*e,240)}ms`),e+=1)});const t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(e.target.classList.add("show"),t.unobserve(e.target))})},{threshold:.16});revealElements.forEach(e=>t.observe(e))}const heroZone=document.getElementById("hero-zone")||document.querySelector(".hero");function triggerHeroPulse(){heroZone&&(prefersReducedMotion||(heroZone.classList.remove("pulse-hit"),heroZone.offsetWidth,heroZone.classList.add("pulse-hit"),window.setTimeout(()=>heroZone.classList.remove("pulse-hit"),520)))}const canvas=document.getElementById("starfield"),ctx=canvas?.getContext("2d");let stars=[],lastStarFrame=0,starsAnimation=null,shootingStars=[];const runtimeFlags={isConstrained:!1,isFirefoxLike:!1,isVivaldi:!1,saveData:!1};function computeRuntimeFlags(){const e=navigator.userAgent||"",t=window.matchMedia?.("(max-width: 820px)")?.matches||!1,n=window.matchMedia?.("(pointer: coarse)")?.matches||!1;runtimeFlags.saveData=navigator.connection?.saveData||!1,runtimeFlags.isConstrained=t||n||runtimeFlags.saveData||prefersReducedMotion,runtimeFlags.isFirefoxLike=e.includes("Firefox")||e.includes("LibreWolf"),runtimeFlags.isVivaldi=/vivaldi/i.test(e)}function getStarFieldProfile(){const e="liquidglass"===document.body.dataset.theme,{isConstrained:t,saveData:n}=runtimeFlags;return n?{density:.22,frameBudget:90}:e&&t?{density:.42,frameBudget:56}:e?{density:.55,frameBudget:46}:t?{density:.72,frameBudget:28}:{density:1,frameBudget:18}}function resizeCanvas(){if(!canvas||!ctx)return;if(prefersReducedMotion)return void(canvas.style.display="none");canvas.style.display="",canvas.width=window.innerWidth,canvas.height=window.innerHeight;const e=getStarFieldProfile(),t=Math.min(140,Math.floor(canvas.width*canvas.height/17500)),n=Math.max(24,Math.floor(t*e.density));stars=Array.from({length:n},()=>({x:Math.random()*canvas.width,y:Math.random()*canvas.height,speed:.2*Math.random()+.05,size:1.05*Math.random()+.22,alpha:.5*Math.random()+.25}))}function spawnShootingStar(){const e=.55*Math.PI+Math.random()*Math.PI*.2,t=8+12*Math.random();shootingStars.push({x:Math.random()*canvas.width*1.4-.2*canvas.width,y:-(10+30*Math.random()),vx:Math.cos(e)*t,vy:Math.sin(e)*t,life:1,decay:.005+.01*Math.random(),trailLen:50+80*Math.random(),thickness:1.2+1.8*Math.random()})}function drawStars(e=0){if(!canvas||!ctx)return;if(document.hidden)return void(starsAnimation=null);const t=getStarFieldProfile(),n=e-lastStarFrame;if(n<t.frameBudget)return void(starsAnimation=requestAnimationFrame(drawStars));const o=Math.min(3,Math.max(.9,n/16.67));lastStarFrame=e,ctx.clearRect(0,0,canvas.width,canvas.height),stars.forEach(e=>{e.y+=e.speed*o,e.y>canvas.height+4&&(e.y=-4,e.x=Math.random()*canvas.width),ctx.beginPath(),ctx.fillStyle=`rgba(193, 222, 255, ${e.alpha})`,ctx.arc(e.x,e.y,e.size,0,2*Math.PI),ctx.fill()});const a=runtimeFlags.isConstrained,i=a?.004:.018;shootingStars.length<(a?2:4)&&Math.random()<i*o&&spawnShootingStar();for(let e=shootingStars.length-1;e>=0;e--){const t=shootingStars[e];if(t.x+=t.vx,t.y+=t.vy,t.life-=t.decay,t.life<=0||t.y>canvas.height+100||t.x>canvas.width+100||t.x<-100){shootingStars.splice(e,1);continue}const n=t.x-t.vx*t.trailLen*.08,o=t.y-t.vy*t.trailLen*.08;ctx.beginPath(),ctx.moveTo(t.x,t.y),ctx.lineTo(n,o);const a=ctx.createLinearGradient(t.x,t.y,n,o);a.addColorStop(0,`rgba(255, 255, 255, ${.85*t.life})`),a.addColorStop(.5,`rgba(180, 220, 255, ${.3*t.life})`),a.addColorStop(1,"rgba(150, 200, 255, 0)"),ctx.strokeStyle=a,ctx.lineWidth=t.thickness*t.life,ctx.lineCap="round",ctx.stroke();const i=4+2*t.thickness,r=ctx.createRadialGradient(t.x,t.y,0,t.x,t.y,i);r.addColorStop(0,`rgba(255, 255, 255, ${.75*t.life})`),r.addColorStop(1,"rgba(180, 215, 255, 0)"),ctx.fillStyle=r,ctx.beginPath(),ctx.arc(t.x,t.y,i,0,2*Math.PI),ctx.fill()}starsAnimation=requestAnimationFrame(drawStars)}function attachTiltBehavior(e){if(prefersReducedMotion)return;if(window.matchMedia&&!window.matchMedia("(hover: hover)").matches)return;let t=null,n=null;const o=()=>{e.style.transform="rotateX(0deg) rotateY(0deg)",e.style.removeProperty("--mx"),e.style.removeProperty("--my"),n=null,t&&(cancelAnimationFrame(t),t=null)};e.addEventListener("mousemove",a=>{n=a,t||(t=requestAnimationFrame(()=>{if(t=null,!n||"liquidglass"===document.body.dataset.theme)return void o();const a=e.getBoundingClientRect(),i=(n.clientX-a.left)/a.width-.5,r=(n.clientY-a.top)/a.height-.5;e.style.transform=`rotateX(${(5*-r).toFixed(2)}deg) rotateY(${(6*i).toFixed(2)}deg)`,e.style.setProperty("--mx",(n.clientX-a.left)/a.width*100+"%"),e.style.setProperty("--my",(n.clientY-a.top)/a.height*100+"%")}))}),e.addEventListener("mouseleave",o)}resizeCanvas(),window.addEventListener("resize",resizeCanvas),prefersReducedMotion||(starsAnimation=requestAnimationFrame(drawStars)),document.addEventListener("visibilitychange",()=>{if(document.hidden)return starsAnimation&&cancelAnimationFrame(starsAnimation),void(starsAnimation=null);prefersReducedMotion||starsAnimation||(starsAnimation=requestAnimationFrame(drawStars))});const tiltElements=document.querySelectorAll(".tilt");tiltElements.forEach(e=>attachTiltBehavior(e));const quoteBtn=document.getElementById("quote-btn"),launchBtn=document.getElementById("launch-btn"),consoleLaunchBtn=document.getElementById("console-launch-btn"),consoleMatrixBtn=document.getElementById("console-matrix-btn"),quoteOutput=document.getElementById("quote-output"),signalCount=document.getElementById("signal-count"),opsTheme=document.getElementById("ops-theme"),opsPulseState=document.getElementById("ops-pulse-state"),opsActiveMode=document.getElementById("ops-active-mode"),opsLastEvent=document.getElementById("ops-last-event"),pulseNodes=Array.from(document.querySelectorAll(".pulse-node")),penguinAvatar=document.querySelector(".penguin-avatar"),penguinBelly=document.querySelector(".penguin-belly"),androidDateBadge=document.querySelector(".android-date-badge"),paletteOpenBtn=document.getElementById("palette-open");let commandPalette=document.getElementById("command-palette"),commandBackdrop=document.getElementById("command-backdrop"),commandInput=document.getElementById("command-input"),commandResults=document.getElementById("command-results");const hamburger=document.querySelector(".hamburger"),siteHeader=document.querySelector(".site-header");hamburger&&siteHeader&&(hamburger.addEventListener("click",()=>{const e=siteHeader.classList.toggle("menu-open");hamburger.classList.toggle("active"),hamburger.setAttribute("aria-expanded",e),document.body.style.overflow=e?"hidden":""}),siteHeader.querySelectorAll("nav a").forEach(e=>{e.addEventListener("click",()=>{siteHeader.classList.remove("menu-open"),hamburger.classList.remove("active"),hamburger.setAttribute("aria-expanded","false"),document.body.style.overflow=""})}),document.addEventListener("click",e=>{siteHeader.classList.contains("menu-open")&&!siteHeader.contains(e.target)&&(siteHeader.classList.remove("menu-open"),hamburger.classList.remove("active"),hamburger.setAttribute("aria-expanded","false"),document.body.style.overflow="")}));const themeColorMeta=document.querySelector('meta[name="theme-color"]'),colorSchemeMeta=document.querySelector('meta[name="color-scheme"]'),quizQuestion=document.getElementById("quiz-question"),quizProgress=document.getElementById("quiz-progress"),quizOptions=document.getElementById("quiz-options"),quizStartBtn=document.getElementById("quiz-start"),quizResetBtn=document.getElementById("quiz-reset"),quizScore=document.getElementById("quiz-score"),headerThemeSelect=document.getElementById("header-theme-select"),themeCycleBtn=document.getElementById("theme-cycle-btn"),heroName=document.getElementById("hero-name"),nameSpeakBtn=document.getElementById("name-speak"),heroStatus=document.getElementById("hero-status"),heroTagline=document.getElementById("hero-tagline"),pageFooterLine=document.getElementById("page-footer-line"),miniTerminalForm=document.getElementById("mini-terminal-form"),miniTerminalInput=document.getElementById("mini-terminal-input"),miniTerminalOutput=document.getElementById("mini-terminal-output"),miniTerminalScreen=document.querySelector(".mini-terminal-screen"),miniTerminalTheme=document.getElementById("mini-terminal-theme"),NEPAL_TIMEZONE="Asia/Kathmandu",BS_CONVERTER_URL="https://cdn.jsdelivr.net/npm/nepali-date-library@1.1.9/+esm",THEME_STORAGE_KEY="neoThemeVariant.v1",ACTION_STORAGE_KEY="neoAutoAction.v1",HERO_TYPED_KEY="neoHeroTyped.v1",MINI_PROMPT_NERD="╰─❯",MINI_PROMPT_FALLBACK="$",NERD_FONT_FAMILIES=["JetBrainsMono Nerd Font","FiraCode Nerd Font","CaskaydiaCove Nerd Font"],THEME_OPTIONS=["neo","mint","sunset","midnight","ember","arctic","grape","toxic","ocean","bloodmoon","zen","liquidglass","material3","paper","blackflag"],THEME_LABELS={neo:"Neo Blue",mint:"Mint Matrix",sunset:"Sunset Burn",midnight:"Midnight",ember:"Ember",arctic:"Arctic",grape:"Grape Signal",toxic:"Toxic",ocean:"Ocean",bloodmoon:"Blood Moon",zen:"Zen",liquidglass:"Liquid Glass",material3:"Material 3",paper:"Paper",blackflag:"Black Flag"},MAX_TERMINAL_LINES=220,TERMINAL_COMMANDS=["help","whoami","mission","status","clear","stack","skills","age","location","school","goal","motto","books","movies","games","anime","culture","crypto","people","youtube","projects","repo","now","buildlog","launch","insight","quote","matrix","music","elon","istj","reset","quiz","theme","home","about","contact","github","ls","pwd","uname","nepal","date","time","pulse","echo"];let launches=0,lastOpsEvent="Console ready",adToBsConverter=null,startPersonaQuiz=null,currentTheme="neo",terminalHistory=[],terminalHistoryIndex=0,terminalDraft="",blackflagShotLockUntil=0,pulseWaveLayer=null,pulseWaveRing=null,pulseCoreFlash=null,pulseFallbackTimeout=0;const typewriterTokens=new WeakMap,heroTaglineVariants=["Aura Farmer // Builder Mode","Signal > Noise","Open Source // Linux // AI","Debate. Build. Repeat.","Future AI Engineer","Minimal UI, Max Aura","Terminal Mindset","Gongabu to Global"],aiConstellationTaglines=["Current Orbit","Build Focus","Signal > Noise","Open Source Mindset","AI Tools, Real Impact","Future AI Engineer","Curiosity Over Comfort","Mission: Make It Work"],aboutFooterLines=["Aura Farmer: thinking deep, building fast.","Neo lore: chaotic fun, clean execution.","Debate mode always ready, code mode always on.","Space theme, hacker heart, aura farming daily.","Signal over noise, curiosity over comfort.","Gongabu mind, global ambitions.","Arch + Hyprland energy, zero fluff.","Less scrolling, more shipping.","I build fast, debug faster, sleep last.","Chaotic fun with a clean commit history.","Neo ops online. Aura farming in progress.","I argue with logic, not volume.","Code is my canvas, Linux is my brush.","I ship ideas before they feel ready.","Coffee, keyboards, and stubborn curiosity.","Future-proof mindset, present-day hustle.","Minimalism in UI, maximalism in ideas.","I like hard books and harder bugs.","Each commit is a small rebellion.","Curiosity is the only permanent fuel.","Build small. Think big. Iterate always.","Aura farming is a daily discipline.","No fluff, just signal.","Debate mode: always armed with facts.","Quiet focus, loud results.","Ship in public, refine in private.","Chaos is fine when the fundamentals are clean.","I turn problems into prototypes.","Less talk, more terminal.","Neo mindset: stay dangerous, stay curious.","Ideas first, ego last.","If it compiles, it ships.","Hard problems are my cardio.","I collect bugs like trophies.","Design with intent, code with speed.","I don’t chase trends, I build systems.","Not perfect, just progressing.","Signal the mission, cut the noise.","I debate to learn, not to win.","Keyboard warrior, logic defender.","Clean diff, loud impact.","Every error is an invitation.","Debugging is my form of meditation.","Weird ideas, real builds.","No sleep, just prototypes.","I’m not late, I’m iterating.","Neo energy, Gongabu roots.","Courage is just a commit away.","Minimal UI, maximal aura.","Rust? Python? I’m still shipping.","Everything is solvable with enough clarity.","A good argument is just a clean stack trace.","I build the thing I wanted to exist.","Aura farming is just consistent output.","I read error messages after I panic.","Fast feedback beats perfect plans.","Learn fast, ship faster.","Discipline beats motivation on slow days."],quotes=["Aura farmer protocol: build daily.","Debate mode: logic over noise.","AI mindset: practical systems beat hype.","Neo mode: stay curious, stay dangerous.","Open source: ship in public, improve fast.","Discipline is a multiplier.","Bug found, ego down, skills up.","My keyboard gets more workouts than I do.","Coffee in, code out.","If it compiles first try, I get suspicious.","Linux teaches patience and power.","The stack trace is a treasure map.","I do not fear hard problems, I schedule them.","Small commits, big progress.","Git is my memory when my brain cache misses.","Every error message is free tutoring.","I refactor because future-me has standards.","A good engineer is a professional note taker.","If docs are optional, chaos is mandatory.","Late night coding is just time travel with bugs.","Do not panic. Read the logs.","Everything is impossible until it is merged.","I talk fast, type faster, debug longest.","Coding is 10 percent typing and 90 percent thinking.","The best optimization is deleting useless code.","When in doubt, write tests.","Future AI engineer loading.","I break things to understand them deeply.","Neat code is silent confidence.","I like open source because receipts are public.","Less scrolling, more shipping.","Touch grass, then touch code.","I do not chase trends, I build systems.","One more commit and then I sleep. Maybe.","My room is messy, my logic is not.","I solve a Rubik's cube faster than bad architecture.","Debate skill unlocked: argue with facts, not volume.","Speak clearly, code clearly.","No excuses in prod, only fixes.","The matrix is real, it is called dependency hell.","If you can explain it simply, you own it.","Read books, write code, repeat.","Philosophy for coders: know thy bug.","Discipline beats motivation on slow days.","I like difficult books and difficult problems.","Linux terminal is where confidence lives.","I ship weird ideas on purpose.","Chaos is fine if your fundamentals are clean.","Minimal UI, maximal aura.","Never trust a silent build pipeline.","A fast learner is a dangerous builder.","No roadmap survives first user feedback.","Programmer joke: I changed one line and fixed five bugs. I changed it back and fixed six.","I do not copy code blindly. I audit it.","If your code needs luck, it needs work.","Readable code is social respect.","Quality is not extra. It is the job.","Ship in public, improve in public.","Keyboard shortcuts are free power-ups.","You do not need permission to learn deeply.","I like ideas that scare lazy people.","Every repo is a time capsule of decisions.","Winners take notes, builders take action.","I test edge cases because reality is rude.","A bug report is a love letter from production.","No one debates better than clean evidence.","The simplest fix that works is elite.","Logs do not lie, assumptions do.","Version control is emotional control.","If there is no challenge, there is no story.","Calm mind, sharp output.","I learn faster than yesterday's excuses.","I do not chase perfection, I chase iteration.","The command line never gaslights.","Security is a feature, not a patch note.","Tight loops build strong intuition.","Complexity grows by default. Simplicity takes intent.","Best flex: clean architecture at midnight.","Sometimes the fix is deleting the feature.","Great products are edited, not just built.","The grind looks boring before it looks legendary.","If you cannot measure it, you cannot improve it.","No drama in commits, only clarity.","AI is leverage for builders who think clearly.","I optimize for signal, not noise.","My tabs are many, my focus is one.","I break procrastination with the first commit.","Crypto taught me risk, code taught me control.","Fewer excuses, more pull requests.","Quiet room, loud ideas.","Impossible is usually undocumented.","The TODO list fears consistency.","My English is fluent, my code should be too.","I can debate anything, but I prefer shipping.","Wired for learning, built for execution.","Fun fact: production finds every shortcut.","Build habits, not hype.","Bug today, lesson forever.","There are only 10 kinds of people: those who understand binary and those who do not.","I debug because being psychic is not in the standard library.","Works on my machine is not a deployment strategy.","Programmer humor: semicolon missing, happiness missing.","I would love to change the world, but they will not give me production access.","Any code of your own that you have not looked at for 6 months is someone else's code.","AI quote: automation rewards people who understand systems, not just tools.","First make it work, then make it right, then make it fast.","If at first you do not succeed, call it version 1.0.","There is no place like 127.0.0.1.","My code does not always run, but my confidence compiles.","A clean commit is better than a perfect excuse.","Real flex: readable code at 2 AM.","Hard problems make strong engineers."];function pickRandomQuote(e=""){const t=quotes.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]||quotes[0]}const personaQuizQuestions=[{question:"Your coding peak time?",options:["Early morning","Afternoon","Late night","Random"],answer:1},{question:"When stuck, first move?",options:["Read docs","Use ChatGPT/AI","Ask a friend","Take a break"],answer:1},{question:"Preferred coding drink?",options:["Water","Tea","Coffee","Energy drink"],answer:2},{question:"Desk vibe?",options:["Minimal clean","Controlled chaos","Fully messy","Changes daily"],answer:1},{question:"Hardest school subject?",options:["Math","Science","Nepali/English","C++"],answer:0},{question:"Main motivation source?",options:["Competition","Curiosity","Future goals","Proving doubters wrong"],answer:2},{question:"You read error messages fully before fixing.",options:["True","False"],answer:1},{question:"Best non-Python language for you?",options:["C/C++","JavaScript","Java","None"],answer:0},{question:"Weekend coding hours?",options:["0-2","3-5","6-8","9+"],answer:2},{question:"If code works first try, you?",options:["Celebrate","Distrust it","Commit instantly","Re-run tests"],answer:3},{question:"Book type you enjoy most?",options:["Self-help","Philosophy","Fiction/sci-fi","Biography"],answer:0},{question:"Best study mode?",options:["Silence","Lo-fi/music","Cafe noise","With friends"],answer:1},{question:"In group chats you are:",options:["Silent reader","Meme sender","Problem solver","Debate starter"],answer:3},{question:"If someone challenges your idea:",options:["Defend hard","Ask questions","Test both","Ignore"],answer:0},{question:"You enjoy speaking in front of large groups.",options:["True","False"],answer:0},{question:"Puzzle preference?",options:["Logic grids","Chess","Rubik's cube","Riddles"],answer:2},{question:"Meme style you laugh at most?",options:["Dark humor","Coding memes","Absurd memes","Roasts"],answer:0},{question:"Biggest productivity killer?",options:["Phone","YouTube","Overthinking","Laziness"],answer:1},{question:"File naming style?",options:["Super clean","Kinda clean","Total chaos","Depends on mood"],answer:1},{question:"You make handwritten notes regularly.",options:["True","False"],answer:0},{question:"One app you use most daily?",options:["YouTube","VS Code","Terminal","Messaging app"],answer:0},{question:"Notifications setting?",options:["Always on","Important only","Mostly off","Flight mode often"],answer:2},{question:"Favorite weather?",options:["Rainy","Cold","Sunny","Stormy/cloudy"],answer:2},{question:"Dream place to visit?",options:["Japan","USA","Europe","Other"],answer:3},{question:"Debate strategy?",options:["Facts/data","Logic traps","Calm persuasion","Aggressive style"],answer:1},{question:"You sometimes wait till the last day to finish tasks.",options:["True","False"],answer:0},{question:"If you had a pet:",options:["Dog","Cat","Bird","None"],answer:2},{question:"Coding snack choice?",options:["Chips","Biscuits","Fruits","No snacks"],answer:3},{question:"School break vibe?",options:["Talk with friends","Read/watch stuff","Wander around","Practice debate"],answer:0},{question:"Ideal Saturday?",options:["Build project","Game all day","Go out","Sleep/rest"],answer:0},{question:"What annoys you most?",options:["Slow internet","Bad UI","People acting dumb","Wasted time"],answer:2},{question:"You usually re-read messages before sending.",options:["True","False"],answer:1},{question:"Team role you naturally take:",options:["Leader","Builder","Researcher","Critic"],answer:3},{question:"Favorite compliment to hear?",options:["Smart","Disciplined","Creative","Fearless"],answer:0},{question:"After school your energy is:",options:["High","Medium","Low","Unpredictable"],answer:1},{question:"Skill to max this year?",options:["AI/ML","Communication","Math","Discipline"],answer:2},{question:"You keep backup plans for important goals.",options:["True","False"],answer:1},{question:"In games you pick:",options:["Tactical/stealth","Aggressive fighter","Support/utility","Mixed"],answer:3},{question:"Movie ending preference?",options:["Happy","Dark","Mind-bending","Open ending"],answer:2},{question:"Favorite non-black tone?",options:["Blue","Orange","Red","Green"],answer:0},{question:"If you lose a debate:",options:["Analyze mistakes","Get mad","Move on fast","Demand rematch"],answer:1},{question:"You enjoy routine and structure.",options:["True","False"],answer:1},{question:"If you mastered one instrument:",options:["Guitar","Piano","Drums","Flute"],answer:0},{question:"Dream startup type?",options:["AI tools","EdTech","Gaming tech","Cybersecurity"],answer:0},{question:"Friends describe you as:",options:["Intense","Funny","Reliable","Unpredictable"],answer:1},{question:"Exam style?",options:["Early prep","Steady prep","Last-minute grind","Instinct + luck"],answer:3},{question:"You like unexpected surprises in real life.",options:["True","False"],answer:0},{question:"Best personal motto?",options:["Build daily","Stay dangerous","Discipline > mood","Outsmart chaos"],answer:3},{question:"Ideal birthday plan?",options:["Small close circle","Big party","Solo chill","Build + celebrate"],answer:2},{question:"Hidden question type you want most?",options:["Personal habits","Funny school moments","Secret opinions","Mixed chaos"],answer:3},{question:"Launch pulse message says it launches from:",options:["Gongabu","Mars","Nepal","Matrix"],answer:1},{question:"Drop Insight button does what to pulse chain?",options:["Adds +5 pulses","Resets chain","Starts music","Turns on matrix"],answer:1},{question:"At 5 pulses, which mode unlocks?",options:["ISTJ Grid","Chill Music","Elon Warp","Matrix Rain"],answer:2},{question:"At 10 pulses, which mode unlocks?",options:["Chill Music","Elon Warp","Matrix Rain","ISTJ Grid"],answer:0},{question:"At 15 pulses, which mode unlocks?",options:["Matrix Rain","ISTJ Grid","Chill Music","Elon Warp"],answer:1},{question:"At 20 pulses, which mode unlocks?",options:["ISTJ Grid","Elon Warp","Matrix Rain","Chill Music"],answer:2},{question:"GitHub profile featured on site:",options:["DevXtechnic","BikramGole","NeoCoder","AuraFarmer"],answer:0},{question:"Primary footer email uses which domain?",options:["gmail.com","proton.me","keemail.me","outlook.com"],answer:2},{question:"Main location shown on site:",options:["Pokhara","Gongabu, KTM, Nepal","Lalitpur","Bhaktapur"],answer:1},{question:"Age shown in identity snapshot:",options:["14","15","16","17"],answer:1},{question:"Distro and WM listed in About:",options:["Ubuntu + GNOME","Fedora + KDE","Arch + Hyprland","Debian + i3"],answer:2},{question:"Goal card in About says:",options:["Become a game dev","Become an AI Engineer","Become a trader","Become a designer"],answer:1},{question:"Hero status line says:",options:["Always online","Debater mode always ready","Sleep mode active","Build mode maybe"],answer:1},{question:"Movies list includes:",options:["Interstellar","Ready Player One","Inception","The Dark Knight"],answer:1},{question:"Games list includes:",options:["Valorant","Black Myth: Wukong","CS2","Dota 2"],answer:1},{question:"Anime list includes:",options:["Jujutsu Kaisen","Demon Slayer","Classroom of the Elite","Bleach"],answer:2},{question:"Books list includes:",options:["Atomic Habits","Sapiens","1984","The Alchemist"],answer:2},{question:"AI leaders card lists:",options:["Mark Zuckerberg, Sundar Pichai, Satya Nadella","Sam Altman, Dario Amodei, Elon Musk","Linus Torvalds, Guido van Rossum, Vitalik Buterin","Andrew Ng, Ilya Sutskever, Jensen Huang"],answer:1},{question:"YouTube card lists:",options:["Luke Smith and Fireship","Matt Wolfe and AI Explained","Lex Fridman and Huberman","MKBHD and Veritasium"],answer:1},{question:"The penguin tummy badge displays:",options:["Static </> tag","Current BS day number","Current AD month","CPU usage"],answer:1},{question:"Quick panel open hint is shown as:",options:["Ctrl/Cmd + K","Alt + P","Ctrl/🐧 + K","Shift + Space"],answer:2},{question:"Navbar pages are:",options:["Home, Projects, Blog","Home, About, Contact","About, Works, Contact","Home only"],answer:1},{question:"Default site vibe is:",options:["Light and minimal","Dark playful space theme","Corporate white","Monochrome print style"],answer:1},{question:"Each quiz run currently asks:",options:["3 random questions","5 random questions","10 random questions","All questions"],answer:2},{question:"Launch Pulse includes:",options:["Only text update","Visual + sound reaction","Only sound","Only matrix effect"],answer:1},{question:"Which mode adds falling code rain?",options:["ISTJ mode","Elon mode","Matrix mode","Chill mode"],answer:2},{question:"The chaos tagline used on site is:",options:["Aura Farmer","System Hacker","Cloud Ninja","Night Coder"],answer:0},{question:"Brand name shown in header:",options:["Bikram","Aura","Neo","DevX"],answer:2},{question:"Which section fetches repositories from GitHub API?",options:["Mission Console","Persona Quiz","Culture + Brain Fuel","Live GitHub"],answer:3},{question:"Which movie in your list is based on a virtual-world competition?",options:["Nayak","Ready Player One","BFG","The Real Jackpot"],answer:1},{question:"Which keyboard combo opens the command palette on site?",options:["Ctrl + P","Ctrl + J","Ctrl + K","Alt + Enter"],answer:2},{question:"In Black Flag theme, the hero gun appears on which side of title?",options:["Left","Right","Both sides","It is hidden"],answer:0},{question:"Which mode label replaced the old Libertarian theme?",options:["Paper Link","Neo Blue","Black Flag Uprising","Blood Moon"],answer:2},{question:"What vibe best matches this site?",options:["Corporate dashboard","Chaotic fun","News portal","Minimal blog"],answer:1},{question:"Which email is marked as Primary in Contact?",options:["Developer.genius@gmail.com","bikramgole.genius@gmail.com","neo@matrix.com","devx@proton.me"],answer:1},{question:"What does the quiz do when current pool runs out?",options:["Auto-download more","Stops and asks reset/refresh","Repeats previous 10","Crashes intentionally"],answer:1},{question:"Which page describes Identity Snapshot?",options:["Home","Contact","About","All pages"],answer:2},{question:"Which section title includes the word Console?",options:["Mission Console","Open Channel","Identity Snapshot","Live GitHub"],answer:0},{question:"What is the section where custom commands run?",options:["AI Constellation","Neo Terminal","Culture + Brain Fuel","Direct Links"],answer:1},{question:"Which item is NOT in your stated interests?",options:["Linux","Open source","Philosophy","Golf"],answer:3},{question:"What theme style did you explicitly reject?",options:["Dark mode","Light chunky UI","Space visuals","Interactive effects"],answer:1},{question:"Which phrase best describes your debate style from quiz answers?",options:["Avoid conflict","Logic traps","Only humor","Never defend ideas"],answer:1},{question:"What is shown under your strengths in About?",options:["Great English speaker","Graphic design only","Cooking","Photography"],answer:0},{question:"Which card category appears in Culture + Brain Fuel?",options:["Podcasts","Movies","Travel","Finance index"],answer:1},{question:"What is the intended deploy target for this site?",options:["Heroku","GitHub Pages","Netlify Functions only","Vercel Edge only"],answer:1},{question:"Which operating style matches your identity line?",options:["Mac + Finder","Windows + Explorer","Arch + Hyprland","ChromeOS"],answer:2},{question:"The persona nickname used in branding is:",options:["Cipher","Neo","Agent","Root"],answer:1},{question:"What happens at 20 pulse milestone?",options:["Theme reset","Matrix Rain","Quiz reset","Music off"],answer:1},{question:"Which card appears in AI + Influence Stack?",options:["Crypto","Car collection","Sports team","Fitness plan"],answer:0},{question:"Which section pushes your quote/insight lines with typing effect?",options:["Mission Console","Direct Links","Live GitHub","Identity Snapshot"],answer:0}];function triggerPulseBackdrop(e=null,t=null){const n=window.innerWidth||1,o=window.innerHeight||1,a="number"==typeof e&&e>0?e:.5*n,i="number"==typeof t&&t>0?t:.35*o,{isConstrained:r,isFirefoxLike:s}=runtimeFlags;pulseWaveLayer||(pulseWaveLayer=document.createElement("div"),pulseWaveLayer.className="pulse-wave",pulseWaveRing=document.createElement("span"),pulseWaveRing.className="pulse-wave-ring",pulseWaveLayer.appendChild(pulseWaveRing),document.body.appendChild(pulseWaveLayer)),pulseCoreFlash||(pulseCoreFlash=document.createElement("span"),pulseCoreFlash.className="pulse-core-flash",document.body.appendChild(pulseCoreFlash));const l=`${Math.round(a/n*100)}%`,u=`${Math.round(i/o*100)}%`;if(pulseWaveLayer.style.setProperty("--pulse-x",l),pulseWaveLayer.style.setProperty("--pulse-y",u),pulseCoreFlash.style.left=`${a}px`,pulseCoreFlash.style.top=`${i}px`,pulseWaveLayer.classList.remove("pulse-active"),pulseCoreFlash.classList.remove("pulse-active"),pulseWaveLayer.offsetWidth,pulseWaveLayer.classList.add("pulse-active"),pulseCoreFlash.classList.add("pulse-active"),pulseFallbackTimeout&&window.clearTimeout(pulseFallbackTimeout),pulseFallbackTimeout=window.setTimeout(()=>{pulseWaveLayer?.classList.remove("pulse-active"),pulseCoreFlash?.classList.remove("pulse-active")},920),s||r||"function"!=typeof pulseWaveLayer.animate||"function"!=typeof pulseCoreFlash.animate)return;pulseWaveLayer.getAnimations().forEach(e=>e.cancel()),pulseWaveRing?.getAnimations().forEach(e=>e.cancel()),pulseCoreFlash.getAnimations().forEach(e=>e.cancel());const c=r?640:820,d=r?1.12:1.2;try{pulseWaveLayer.animate([{transform:"scale(0.92)",opacity:0},{opacity:s?.62:.82,offset:.18},{opacity:.3,offset:.6},{transform:`scale(${d})`,opacity:0}],{duration:c,easing:"cubic-bezier(0.16, 0.82, 0.27, 1)",fill:"forwards"}),pulseWaveRing?.animate([{transform:"translate(-50%, -50%) scale(0.34)",opacity:.95},{transform:`translate(-50%, -50%) scale(${r?9.5:13})`,opacity:0}],{duration:c,easing:"ease-out",fill:"forwards"}),pulseCoreFlash.animate([{transform:"translate(-50%, -50%) scale(0.45)",opacity:.9},{transform:"translate(-50%, -50%) scale(3.4)",opacity:0}],{duration:r?320:420,easing:"cubic-bezier(0.2, 0.7, 0.3, 1)",fill:"forwards"})}catch(e){}}function playPulseSound(e=1){const t=ensureAudioContext();if(!t)return;const n=t.currentTime,o=t.createOscillator(),a=t.createOscillator(),i=t.createGain(),r=t.createBiquadFilter(),s=e%6*22;o.type="triangle",o.frequency.setValueAtTime(460+s,n),o.frequency.exponentialRampToValueAtTime(170,n+.2),a.type="sine",a.frequency.setValueAtTime(90,n),a.frequency.exponentialRampToValueAtTime(52,n+.2),r.type="bandpass",r.frequency.setValueAtTime(980,n),r.frequency.exponentialRampToValueAtTime(420,n+.2),r.Q.value=1.1,i.gain.setValueAtTime(1e-4,n),i.gain.exponentialRampToValueAtTime(.17,n+.02),i.gain.exponentialRampToValueAtTime(1e-4,n+.22),o.connect(r),a.connect(r),r.connect(i).connect(t.destination),o.start(n),a.start(n),o.stop(n+.24),a.stop(n+.24)}function triggerPenguinPowerUp(){penguinAvatar&&(prefersReducedMotion||(penguinAvatar.classList.remove("power-up"),penguinAvatar.offsetWidth,penguinAvatar.classList.add("power-up"),window.setTimeout(()=>penguinAvatar.classList.remove("power-up"),620)))}function initRuntimeCompatibility(){const e=()=>{computeRuntimeFlags(),document.body.classList.toggle("browser-firefox",runtimeFlags.isFirefoxLike),document.body.classList.toggle("browser-not-firefox",!runtimeFlags.isFirefoxLike),document.body.classList.toggle("browser-vivaldi",runtimeFlags.isVivaldi),document.body.classList.toggle("force-terminal-fallback",runtimeFlags.isConstrained),resizeCanvas()};e(),window.addEventListener("resize",e)}function applyTerminalFontFallbackMode(){if(document.body.classList.contains("force-terminal-fallback"))return void document.body.classList.add("no-nerd-font");const e=NERD_FONT_FAMILIES.some(e=>!!window?.document?.fonts?.check&&window.document.fonts.check(`12px "${e}"`));document.body.classList.toggle("no-nerd-font",!e)}function initTerminalFontFallbackMode(){applyTerminalFontFallbackMode(),window?.document?.fonts?.ready&&window.document.fonts.ready.then(()=>applyTerminalFontFallbackMode()).catch(()=>{})}function initPenguinDateBadge(){if(!penguinBelly&&!androidDateBadge)return;let e="";const t=async()=>{const t=(()=>{const e=new Intl.DateTimeFormat("en-US",{timeZone:NEPAL_TIMEZONE,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date),t=e.find(e=>"year"===e.type)?.value,n=e.find(e=>"month"===e.type)?.value,o=e.find(e=>"day"===e.type)?.value;return`${t}-${n}-${o}`})();if(t===e&&(penguinBelly?.dataset.day||androidDateBadge?.dataset.day))return;let n=null;const o=await(async()=>{if(adToBsConverter)return adToBsConverter;try{const e=await import(BS_CONVERTER_URL);"function"==typeof e.ADtoBS&&(adToBsConverter=e.ADtoBS)}catch(e){adToBsConverter=null}return adToBsConverter})();if(o)try{n=(e=>{if("string"==typeof e){const t=e.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/);if(t)return{year:Number.parseInt(t[1],10),month:Number.parseInt(t[2],10),day:Number.parseInt(t[3],10)}}return e&&"object"==typeof e&&"day"in e?{year:Number.parseInt(e.year,10),month:Number.parseInt(e.month,10),day:Number.parseInt(e.day,10)}:null})(o(t))}catch(e){n=null}const a=new Intl.DateTimeFormat("en-US",{timeZone:NEPAL_TIMEZONE,day:"numeric"}).format(new Date);if(penguinBelly&&(penguinBelly.dataset.day=String(n?.day||a)),androidDateBadge){const e=String(n?.day||a);androidDateBadge.textContent=e,androidDateBadge.dataset.day=e}e=t};t(),window.setInterval(()=>{t()},6e4)}function applyTheme(e,t=!1,n=t||Boolean(getThemeFromUrl())){const o=THEME_OPTIONS.includes(e)?e:"neo";currentTheme=o,document.documentElement.dataset.theme=o,document.body.dataset.theme=o;const a="paper"===o,i=getComputedStyle(document.documentElement).getPropertyValue("--bg-0").trim();themeColorMeta&&i&&themeColorMeta.setAttribute("content",i),colorSchemeMeta&&colorSchemeMeta.setAttribute("content",a?"light":"dark"),document.documentElement.style.colorScheme=a?"light":"dark",headerThemeSelect&&(headerThemeSelect.value=o),heroName&&("blackflag"===o&&heroName.textContent.trim().length>0?heroName.classList.add("name-armed"):heroName.classList.remove("name-armed")),miniTerminalTheme&&(miniTerminalTheme.textContent=`theme: ${o}`);try{window.localStorage.setItem(THEME_STORAGE_KEY,o)}catch(e){}n&&setThemeInUrl(o),updateInternalLinks(),resizeCanvas(),updateOpsDeck(t?`Theme set to ${o}`:lastOpsEvent),t&&showToast(`Theme changed: ${o}`)}function initThemeSwitcher(){let e="mint";try{const t=getThemeFromUrl(),n=window.localStorage.getItem(THEME_STORAGE_KEY);e=t||n||"mint",window.localStorage.setItem(THEME_STORAGE_KEY,e)}catch(t){e="mint"}applyTheme(e,!1),window.addEventListener("pageshow",()=>{let e="mint";try{const t=getThemeFromUrl(),n=window.localStorage.getItem(THEME_STORAGE_KEY);e=t||n||"mint"}catch(t){e="mint"}e!==currentTheme&&applyTheme(e,!1)}),window.addEventListener("storage",e=>{e.key===THEME_STORAGE_KEY&&e.newValue&&THEME_OPTIONS.includes(e.newValue)&&e.newValue!==currentTheme&&applyTheme(e.newValue,!1)}),headerThemeSelect?.addEventListener("change",e=>{applyTheme(e.target.value,!0)}),themeCycleBtn?.addEventListener("click",()=>{const e=THEME_OPTIONS.indexOf(currentTheme);applyTheme(THEME_OPTIONS[(e+1+THEME_OPTIONS.length)%THEME_OPTIONS.length],!0)})}function initPageTransition(){const e=document.getElementById("page-transition");e&&!prefersReducedMotion&&(e.style.transition="none",e.style.opacity="1",requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.transition="opacity var(--motion-base) ease",e.style.opacity="0"})}),document.querySelectorAll('a[href$=".html"], a[href*=".html?"]').forEach(t=>{t.addEventListener("click",n=>{if(n.metaKey||n.ctrlKey||n.shiftKey||1===n.button)return;const o=t.getAttribute("href");!o||o.startsWith("http")||o.startsWith("#")||(n.preventDefault(),e.style.transition="opacity var(--motion-base) ease",e.style.opacity="1",setTimeout(()=>{window.location.href=o},240))})}))}function initPageMascot(){const e=document.getElementById("page-mascot");if(!e||prefersReducedMotion)return;if(window.matchMedia?.("(pointer: coarse)").matches)return void(e.style.display="none");let t=window.innerWidth/2,n=window.innerHeight/2,o=t,a=n;document.addEventListener("mousemove",e=>{t=e.clientX,n=e.clientY}),requestAnimationFrame(function i(){o+=.12*(t-o),a+=.12*(n-a),e.style.left=o+"px",e.style.top=a+"px",requestAnimationFrame(i)})}function initNavThemeGuard(){document.querySelectorAll('a[href$=".html"], a[href*=".html?"]').forEach(e=>{e.addEventListener("click",()=>{try{const t=THEME_OPTIONS.includes(currentTheme)?currentTheme:"neo";window.localStorage.setItem(THEME_STORAGE_KEY,t);const n=e.getAttribute("href");n&&e.setAttribute("href",applyThemeToUrl(n,t))}catch(e){}})})}function spawnBlackflagShot(e,t,n,o=null,a=null){const i=document.createElement("span");i.className="gun-bullet",i.style.left=`${e}px`,i.style.top=`${t}px`,document.body.appendChild(i);const r="left"===n?e+.58*window.innerWidth:e-.58*window.innerWidth,s=t+("left"===n?6:-6),l=(Number.isFinite(o)?o:r)-e,u=(Number.isFinite(a)?a:s)-t,c=Math.atan2(u,l)*(180/Math.PI),d=Math.max(260,Math.min(920,Math.hypot(l,u))),m=l/(Math.hypot(l,u)||1)*d,p=u/(Math.hypot(l,u)||1)*d;i.animate([{transform:`translate(-50%, -50%) rotate(${c}deg) scaleX(1)`,opacity:1},{transform:`translate(calc(-50% + ${m}px), calc(-50% + ${p}px)) rotate(${c}deg) scaleX(0.46)`,opacity:0}],{duration:340,easing:"cubic-bezier(0.12, 0.77, 0.3, 1)",fill:"forwards"}).onfinish=()=>i.remove();const h=document.createElement("span");h.className="gun-flash",h.style.left=`${e}px`,h.style.top=`${t}px`,document.body.appendChild(h),h.animate([{transform:"translate(-50%, -50%) scale(0.55)",opacity:.95},{transform:"translate(-50%, -50%) scale(1.75)",opacity:0}],{duration:170,easing:"ease-out",fill:"forwards"}).onfinish=()=>h.remove()}function triggerBlackflagBlast(e,t){const n=document.createElement("span");n.className="gun-flash",n.style.left=`${e}px`,n.style.top=`${t}px`,n.style.width="66px",n.style.height="66px",n.style.transform="translate(-50%, -50%)",document.body.appendChild(n),window.setTimeout(()=>n.remove(),170)}function updateBlackflagGunAim(e,t,n){if(!heroName)return;const o=n.left+.5*n.width,a=n.top+.55*n.height,i=Number.isFinite(e)?e:o,r=Number.isFinite(t)?t:a,s=n.left-26,l=Math.atan2(r-a,i-s)*(180/Math.PI),u=(e,t,n)=>Math.max(t,Math.min(n,e)),c=u(.12*(r-a),-12,12),d=u(.02*(i-o),-8,8);heroName.style.setProperty("--gun-left-angle",`${u(l,-80,80)}deg`),heroName.style.setProperty("--gun-y-shift",`${c}px`),heroName.style.setProperty("--gun-left-x",`${d}px`)}function fireBlackflagShots(e=null){if("blackflag"!==currentTheme)return;if(!heroName||!heroName.classList.contains("name-armed"))return;const t=performance.now();if(t<blackflagShotLockUntil)return;blackflagShotLockUntil=t+160;const n=heroName.getBoundingClientRect(),o=window.getComputedStyle(heroName),a=Number.parseFloat(o.getPropertyValue("--gun-anchor-x"))||-28,i=Number.parseFloat(o.getPropertyValue("--gun-muzzle-len"))||154,r=n.top+.56*n.height,s=n.left+a,l=Number.isFinite(e?.clientX)?e.clientX:n.left+.5*n.width,u=Number.isFinite(e?.clientY)?e.clientY:r;updateBlackflagGunAim(l,u,n);const c=Math.atan2(u-r,l-s)*(180/Math.PI)*Math.PI/180;spawnBlackflagShot(s+Math.cos(c)*i,r+Math.sin(c)*i,"left",l,u),e?.clientX&&e?.clientY&&triggerBlackflagBlast(e.clientX,e.clientY)}function initBlackflagGunfire(){document.addEventListener("click",e=>{fireBlackflagShots(e)})}function appendTerminalLine(e,t="out"){if(!miniTerminalOutput)return;const n=document.createElement("p");for(n.className=`mini-terminal-line ${t}`,n.textContent=e,miniTerminalOutput.appendChild(n);miniTerminalOutput.childElementCount>220;)miniTerminalOutput.removeChild(miniTerminalOutput.firstElementChild);miniTerminalOutput.scrollTop=miniTerminalOutput.scrollHeight}function getMiniPrompt(){return document.body.classList.contains("no-nerd-font")||document.body.classList.contains("force-terminal-fallback")?"$":"╰─❯"}function clearTerminalOutput(){miniTerminalOutput&&(miniTerminalOutput.innerHTML="")}function typeTextTo(e,t,n=36,o=""){if(!e)return;if(prefersReducedMotion)return void(e.textContent=`${o}${t||""}`);const a=(typewriterTokens.get(e)||0)+1;typewriterTokens.set(e,a),e.textContent=o;let i=0;const r=()=>{typewriterTokens.get(e)===a&&(i+=1,e.textContent=`${o}${t.slice(0,i)}`,i<t.length&&window.setTimeout(r,n))};t&&window.setTimeout(r,n)}function autocompleteTerminalInput(e){const t=e.trimStart().split(/\s+/),n=t[0]?.toLowerCase()||"",o=t.slice(1).join(" ").toLowerCase();if(!n)return e;if(t.length<=1&&!e.endsWith(" ")){const t=TERMINAL_COMMANDS.filter(e=>e.startsWith(n));return 1===t.length?`${t[0]} `:e}if("theme"===n){const e=THEME_OPTIONS.filter(e=>e.startsWith(o));if(1===e.length)return`theme ${e[0]}`}return e}async function runTerminalCommand(e){const t=e.trim();if(!t)return;appendTerminalLine(`${getMiniPrompt()} ${t}`,"cmd");const[n,...o]=t.split(/\s+/),a=n.toLowerCase(),i=o.join(" "),r=i.toLowerCase();if("help"===a)appendTerminalLine("Commands:"),appendTerminalLine("core: help, whoami, mission, status, clear"),appendTerminalLine("profile: stack, skills, age, location, school, goal, motto"),appendTerminalLine("media: books, movies, games, anime, culture, crypto, people, youtube"),appendTerminalLine("actions: launch, insight, quote, matrix, music, elon, istj, reset, quiz"),appendTerminalLine(`theme: theme, theme <name> (${THEME_OPTIONS.join(", ")})`),appendTerminalLine("nav: home, about, contact, github"),appendTerminalLine("projects: projects, repo <ytdaily|cava|prompt>"),appendTerminalLine("live: now, buildlog"),appendTerminalLine("shell fun: ls, pwd, uname, nepal, date, time, pulse, echo <text>");else if("whoami"===a)appendTerminalLine("Bikram Gole | Aura Farmer");else if("mission"===a)appendTerminalLine("Mission: become an AI engineer and ship useful projects.");else if("status"===a)appendTerminalLine(`Signals launched: ${launches}. Theme: ${currentTheme}.`);else if("stack"===a||"skills"===a)appendTerminalLine("Stack: Python, C/C++, Linux, AI tools, open source.");else if("age"===a)appendTerminalLine(`Age: ${getAge()}`);else if("location"===a)appendTerminalLine("Location: Gongabu, KTM, Nepal.");else if("school"===a)appendTerminalLine("School: Shivapuri Secondary School.");else if("goal"===a)appendTerminalLine("Goal: AI Engineer.");else if("motto"===a)appendTerminalLine("Motto: Outsmart chaos.");else if("books"===a)appendTerminalLine("Books: 1984, Can't Hurt Me, Elon Musk, All Tomorrows, I Have No Mouth and I Must Scream.");else if("movies"===a)appendTerminalLine("Movies: The Matrix, The Monkey King, Robot, 2.0, The Real Jackpot, Nayak, Ready Player One, Squid Game, BFG.");else if("games"===a)appendTerminalLine("Games: Black Myth: Wukong, Minecraft, Detroit: Become Human, God of War.");else if("anime"===a)appendTerminalLine("Anime: Death Note, Monster, Psycho-Pass, The 7 Deadly Sins, Attack on Titan, Naruto, My Hero Academia, Classroom of the Elite, Baki.");else if("culture"===a)appendTerminalLine("Culture: dystopia books, mind-bending movies, story-heavy games, psychological anime.");else if("projects"===a)appendTerminalLine("Projects:"),appendTerminalLine("> ytdaily - automation and workflow experiments"),appendTerminalLine("> cava - Hyprland Cava Underlay"),appendTerminalLine("> KinaHub - full-stack GitHub repo explorer");else if("now"===a)appendTerminalLine("Now orbiting: useful AI, cleaner terminal UX, Linux-native aesthetics, sharper project storytelling.");else if("buildlog"===a)appendTerminalLine("Recent upgrades:"),appendTerminalLine("> spotlight cards now explain why the projects matter"),appendTerminalLine("> culture section now scans as cards and tags"),appendTerminalLine("> terminal now has project-aware commands");else if("repo"===a)r?"ytdaily"===r?(window.open("https://github.com/DevXtechnic/Ytdaily","_blank","noopener,noreferrer"),appendTerminalLine("Opened Ytdaily.")):"cava"===r||"hyprland-cava-underlay"===r?(window.open("https://github.com/DevXtechnic/hyprland-cava-underlay","_blank","noopener,noreferrer"),appendTerminalLine("Opened Hyprland Cava Underlay.")):"kinahub"===r||"kina-hub"===r?(window.open("https://github.com/DevXtechnic/KinaHub","_blank","noopener,noreferrer"),appendTerminalLine("Opened KinaHub.")):appendTerminalLine("Unknown repo. Use: ytdaily, cava, kinahub.","warn"):appendTerminalLine("Use: repo ytdaily | repo cava | repo kinahub","warn");else if("crypto"===a)appendTerminalLine("Crypto: BTC, Ethereum, Monero, Solana.");else if("people"===a)appendTerminalLine("People: Sam Altman, Dario Amodei, Elon Musk, Linus Torvalds, Terry A. Davis.");else if("youtube"===a)appendTerminalLine("YouTube: AI Explained, Matt Wolfe, Luke Smith, Mental Outlaw, Linus Tech Tips, IN-Depth Story, HowToMen, The Linux Experiment, Fireship.");else if("launch"===a)launchPulse(),appendTerminalLine("Launch pulse fired.");else if("insight"===a)quoteBtn?.click(),appendTerminalLine("Dropped new insight.");else if("quote"===a){const e=pickRandomQuote();quoteOutput&&typeTextTo(quoteOutput,e,18,"> "),appendTerminalLine(`"${e}"`)}else if("matrix"===a)toggleMatrixMode(),appendTerminalLine("Matrix mode toggled.");else if("music"===a)toggleFunkAudio(),appendTerminalLine("Chill music toggled.");else if("elon"===a)toggleElonMode(),appendTerminalLine("Elon warp toggled.");else if("istj"===a)toggleISTJMode(),appendTerminalLine("ISTJ grid toggled.");else if("reset"===a)resetPulseChain(),appendTerminalLine("Pulse chain reset.");else if("quiz"===a)startPersonaQuiz?.(),appendTerminalLine("Quiz sequence initiated.");else if("theme"===a)if(r)if("random"===r){const e=THEME_OPTIONS.filter(e=>e!==currentTheme),t=e[Math.floor(Math.random()*e.length)]||"neo";applyTheme(t,!0),appendTerminalLine(`Applied random theme: ${t}.`)}else THEME_OPTIONS.includes(r)?(applyTheme(r,!0),appendTerminalLine(`Applied theme: ${r}.`)):appendTerminalLine(`Invalid theme. Use: random, ${THEME_OPTIONS.join(", ")}.`,"warn");else appendTerminalLine(`Current theme: ${currentTheme}.`);else if("home"===a)scrollToSection("hero-zone"),appendTerminalLine("Jumped to home.");else if("about"===a)navigateToPage("about.html");else if("contact"===a)navigateToPage("contact.html");else if("github"===a)window.open("https://github.com/DevXtechnic","_blank","noopener,noreferrer"),appendTerminalLine("Opened GitHub profile.");else if("ls"===a)appendTerminalLine("sections: hero-zone mission-console ai-constellation culture-brain neo-terminal persona-quiz github-live");else if("pwd"===a)appendTerminalLine("/home/neo/aura-site");else if("uname"===a)appendTerminalLine("Arch Linux + Hyprland");else if("nepal"===a){const e=["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Poush","Magh","Falgun","Chaitra"];try{const t=new Intl.DateTimeFormat("en-US",{timeZone:NEPAL_TIMEZONE,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date),n=`${t.find(e=>"year"===e.type).value}-${t.find(e=>"month"===e.type).value}-${t.find(e=>"day"===e.type).value}`;let o="";const a=await import(BS_CONVERTER_URL);if("function"==typeof a.ADtoBS){const t=a.ADtoBS(n),i=t&&"object"==typeof t&&"day"in t?t:(()=>{const e=String(t).match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/);return e?{year:e[1],month:e[2],day:e[3]}:null})();i&&(o=` | BS: ${e[Number(i.month)-1]} ${i.day}, ${i.year}`)}appendTerminalLine(`Timezone: Asia/Kathmandu | Base: Gongabu, KTM, Nepal${o}`)}catch{appendTerminalLine("Timezone: Asia/Kathmandu | Base: Gongabu, KTM, Nepal")}}else"date"===a||"time"===a?appendTerminalLine((new Date).toLocaleString("en-US")):"pulse"===a?appendTerminalLine(`Current pulse count: ${launches}`):"echo"===a?appendTerminalLine(i||""):"clear"===a?clearTerminalOutput():appendTerminalLine(`Unknown command: ${a}. Use "help".`,"warn")}function initMiniTerminal(){miniTerminalForm&&miniTerminalInput&&(clearTerminalOutput(),appendTerminalLine("kitty-like shell initialized."),appendTerminalLine('Type "help" for commands | ↑/↓ history | Tab autocomplete | Ctrl+L clear.'),appendTerminalLine(`Current theme: ${currentTheme}.`),terminalHistory=[],terminalHistoryIndex=0,terminalDraft="",miniTerminalForm.addEventListener("submit",e=>{e.preventDefault();const t=miniTerminalInput.value;miniTerminalInput.value="";const n=t.trim();n&&(terminalHistory.push(n),terminalHistory.length>120&&terminalHistory.shift()),terminalHistoryIndex=terminalHistory.length,terminalDraft="",runTerminalCommand(t),miniTerminalInput.focus()}),miniTerminalInput.addEventListener("keydown",e=>{if("ArrowUp"===e.key){if(e.preventDefault(),!terminalHistory.length)return;return terminalHistoryIndex===terminalHistory.length&&(terminalDraft=miniTerminalInput.value),terminalHistoryIndex=Math.max(0,terminalHistoryIndex-1),void(miniTerminalInput.value=terminalHistory[terminalHistoryIndex]||"")}if("ArrowDown"===e.key){if(e.preventDefault(),!terminalHistory.length)return;return terminalHistoryIndex=Math.min(terminalHistory.length,terminalHistoryIndex+1),void(terminalHistoryIndex===terminalHistory.length?miniTerminalInput.value=terminalDraft:miniTerminalInput.value=terminalHistory[terminalHistoryIndex]||"")}return"Tab"===e.key?(e.preventDefault(),void(miniTerminalInput.value=autocompleteTerminalInput(miniTerminalInput.value))):e.ctrlKey&&"l"===e.key.toLowerCase()?(e.preventDefault(),clearTerminalOutput(),void appendTerminalLine("screen cleared.")):void 0}),miniTerminalScreen?.addEventListener("click",()=>{miniTerminalInput.focus()}))}function initHeroTypewriters(){if("home"!==page)return;const e=heroName?.dataset.name||heroName?.textContent||"";nameSpeakBtn&&nameSpeakBtn.classList.remove("ready");const t=["Debater mode always active ⚔️","Debater mode always ready...","Aura farmer channel open 🚀","AI engineer loading...","Linux + Arch + Hyprland mode on 🐧","Open source first, excuses never.","I build, break, fix, repeat.","Ctrl + focus + consistency.","Future AI engineer in progress.","Debate me on anything.","Signal over noise, always.","Coffee in, code out ☕","Rubik brain unlocked 🧩","Chaotic fun, clean logic.","Typing fast, thinking faster.","No sleep, more shipping.","Code. Learn. Iterate.","From Gongabu to global ideas.","Matrix mindset online.","Aura farming at max power.","Terminal comfort zone active.","Build in public, grow in public.","Deep work session running...","Ship today, improve tomorrow.","AI + Linux + discipline.","Small wins, big momentum.","Debater mode: evidence only.","Focus protocol engaged.","Curiosity > comfort.","Keep moving. Keep building."];let n=!1,o=!0;try{const e=performance.getEntriesByType("navigation")[0];"reload"===e?.type&&window.sessionStorage.removeItem(HERO_TYPED_KEY),"1"===window.sessionStorage.getItem(HERO_TYPED_KEY)?o=!1:window.sessionStorage.setItem(HERO_TYPED_KEY,"1")}catch(e){o=!0}if(heroName)if(o){heroName.textContent="",heroName.classList.remove("name-armed");let t=0;const o=()=>{t+=1,heroName.textContent=e.slice(0,t),t<e.length?window.setTimeout(o,140):("blackflag"===document.body.dataset.theme&&window.setTimeout(()=>heroName.classList.add("name-armed"),120),n=!0,window.setTimeout(()=>nameSpeakBtn?.classList.add("ready"),120))};window.setTimeout(o,120)}else heroName.textContent=e,"blackflag"===document.body.dataset.theme&&window.setTimeout(()=>heroName.classList.add("name-armed"),80),n=!0,window.setTimeout(()=>nameSpeakBtn?.classList.add("ready"),120);else n=!0,nameSpeakBtn?.classList.add("ready");if(!heroStatus)return;heroStatus.textContent="";let a=Math.floor(Math.random()*t.length),i=0,r=!1;const s=()=>{if(!n)return void window.setTimeout(s,80);const e=t[a];if(!r)return i+=1,heroStatus.textContent=e.slice(0,i),void(i<e.length?window.setTimeout(s,68):(r=!0,window.setTimeout(s,850)));if(i-=1,heroStatus.textContent=i>0?e.slice(0,i):" ",i>0)window.setTimeout(s,40);else{if(r=!1,t.length>1){let e=a;for(;e===a;)e=Math.floor(Math.random()*t.length);a=e}window.setTimeout(s,120)}};window.setTimeout(s,360)}function initCliSnapshotTypewriter(){if("home"!==page)return;const e=document.getElementById("cli-snapshot");if(!e)return;const t=Array.from(e.querySelectorAll(".cli-block span"));if(!t.length)return;const n=t.map(e=>e.textContent||"");if(prefersReducedMotion)return void t.forEach((e,t)=>{e.textContent=n[t]||""});let o=!1;const a=()=>{if(o)return;o=!0;const e=[];t.forEach((t,o)=>{t.classList.contains("cli-output")?(t.textContent="",e.push({span:t,text:n[o]||""})):t.textContent=n[o]||" "});const a=t=>{if(t>=e.length)return;const{span:n,text:o}=e[t],i=o.split(/(\s+)/);let r=0;const s=()=>{r>=i.length?window.setTimeout(()=>a(t+1),360):(r++,n.textContent=i.slice(0,r).join(""),window.setTimeout(s,100+80*Math.random()))};s()};window.setTimeout(()=>a(0),360)};if("IntersectionObserver"in window){const t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(a(),t.disconnect())})},{threshold:.2});t.observe(e)}else a()}function initNamePronounce(){if(!nameSpeakBtn)return;const e=new Audio("bikramgole.wav");e.preload="auto";const t=e=>{nameSpeakBtn.classList.toggle("speaking",e),nameSpeakBtn.setAttribute("aria-pressed",e?"true":"false")};e.onplay=()=>{t(!0),nameSpeakBtn.title="Speaking name"},e.onended=()=>{t(!1),nameSpeakBtn.title="Hear my name"},e.onerror=()=>{t(!1),nameSpeakBtn.title="Speech failed on this browser."},nameSpeakBtn.addEventListener("click",()=>{if(!e.paused)return e.pause(),e.currentTime=0,t(!1),void(nameSpeakBtn.title="Hear my name");e.currentTime=0,e.play().catch(()=>{nameSpeakBtn.title="Speech failed on this browser."})})}function initAgeDisplay(){const e=document.getElementById("age-display");e&&(e.textContent=getAge())}function initFooterLineTypewriter(){if(!pageFooterLine)return;if("about"===page){const e=aboutFooterLines[Math.floor(Math.random()*aboutFooterLines.length)];pageFooterLine.dataset.text=e}const e=pageFooterLine.dataset.text||pageFooterLine.textContent||"";pageFooterLine.textContent="",typeTextTo(pageFooterLine,e,38,"")}function scrollToSection(e){const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth",block:"start"})}function getThemeFromUrl(){try{const e=new URLSearchParams(window.location.search).get("theme");return THEME_OPTIONS.includes(e)?e:null}catch(e){return null}}function setThemeInUrl(e){try{const t=new URL(window.location.href);THEME_OPTIONS.includes(e)?t.searchParams.set("theme",e):t.searchParams.delete("theme"),window.history.replaceState(null,"",t.toString())}catch(e){}}function applyThemeToUrl(e,t){try{const n=new URL(e,window.location.href);return THEME_OPTIONS.includes(t)?n.searchParams.set("theme",t):n.searchParams.delete("theme"),n.toString()}catch(t){return e}}function updateInternalLinks(){const e=THEME_OPTIONS.includes(currentTheme)?currentTheme:"neo";document.querySelectorAll("a[href]").forEach(t=>{const n=t.getAttribute("href");!n||n.startsWith("mailto:")||n.startsWith("http")||n.startsWith("#")||"_blank"!==t.getAttribute("target")&&n.includes(".html")&&t.setAttribute("href",applyThemeToUrl(n,e))})}function triggerAction(e){"launch"===e&&launchPulse(),"insight"===e&"eBtn?.click(),"quiz"===e&&startPersonaQuiz?.()}function runOrNavigate(e,t=""){if(e?document.getElementById(e):null)return scrollToSection(e),"neo-terminal"===e&&window.setTimeout(()=>miniTerminalInput?.focus(),220),void(t&&triggerAction(t));t&&sessionStorage.setItem("neoAutoAction.v1",t);const n=applyThemeToUrl(`index.html${e?`#${e}`:""}`,currentTheme);window.location.href=n}function navigateToPage(e){const t=applyThemeToUrl(e,currentTheme);window.location.href=t}function initAiConstellationTagline(){if("home"!==page)return;const e=document.querySelector("#ai-constellation .chaos-card.c4 p");if(!e)return;const t=aiConstellationTaglines[Math.floor(Math.random()*aiConstellationTaglines.length)];e.textContent=t}function focusTerminalIfNeeded(){"home"===page&&"#neo-terminal"===window.location.hash&&window.setTimeout(()=>miniTerminalInput?.focus(),240)}function ensureCommandPaletteElements(){if(commandPalette&&commandBackdrop&&commandInput&&commandResults)return;const e=document.createElement("div");e.id="command-palette",e.className="command-palette",e.setAttribute("aria-hidden","true"),e.innerHTML='\n <button id="command-backdrop" class="command-backdrop" type="button" aria-label="Close command palette"></button>\n <div class="command-shell" role="dialog" aria-modal="true" aria-labelledby="command-title">\n <div class="command-head">\n <div class="command-title-wrap">\n <span class="linux-mark" aria-hidden="true"></span>\n <h3 id="command-title">Ctrl/🐧 + K Panel</h3>\n </div>\n <span>Neo Ops</span>\n </div>\n <input id="command-input" type="text" placeholder="Type command: quiz, github, matrix..." autocomplete="off" />\n <div id="command-results" class="command-results" role="listbox" aria-label="command results"></div>\n <p class="command-hint">Tip: <kbd>Ctrl/🐧 + K</kbd> to open, <kbd>Esc</kbd> to close.</p>\n </div>\n ',document.body.appendChild(e),commandPalette=e,commandBackdrop=e.querySelector("#command-backdrop"),commandInput=e.querySelector("#command-input"),commandResults=e.querySelector("#command-results")}function initCommandPalette(){if(ensureCommandPaletteElements(),!commandPalette||!commandInput||!commandResults)return;const e=[{label:"Go: Hero",keywords:"home hero top",run:()=>runOrNavigate("hero-zone")},{label:"Go: Mission Console",keywords:"mission pulse console",run:()=>runOrNavigate("mission-console")},{label:"Go: AI Constellation",keywords:"ai constellation leaders build log current orbit",run:()=>runOrNavigate("ai-constellation")},{label:"Go: Culture + Brain Fuel",keywords:"movies games anime books",run:()=>runOrNavigate("culture-brain")},{label:"Go: Neo Terminal",keywords:"terminal shell commands",run:()=>runOrNavigate("neo-terminal")},{label:"Go: Persona Quiz",keywords:"quiz game persona",run:()=>runOrNavigate("persona-quiz")},{label:"Go: Live GitHub",keywords:"github repos projects",run:()=>runOrNavigate("github-live")},{label:"Action: Current Orbit",keywords:"now current orbit focus",run:()=>runOrNavigate("ai-constellation")},{label:"Action: Launch Pulse",keywords:"pulse launch aura",run:()=>runOrNavigate("mission-console","launch")},{label:"Action: Drop Insight",keywords:"insight quote drop",run:()=>runOrNavigate("mission-console","insight")},{label:"Action: Start Persona Quiz",keywords:"quiz start challenge",run:()=>runOrNavigate("persona-quiz","quiz")},{label:"Open: Ytdaily Repo",keywords:"repo ytdaily project",run:()=>window.open("https://github.com/DevXtechnic/Ytdaily","_blank","noopener,noreferrer")},{label:"Open: Fish Prompt Repo",keywords:"repo prompt shell project",run:()=>window.open("https://github.com/DevXtechnic/fish-prompt","_blank","noopener,noreferrer")},{label:"Theme: Neo Blue",keywords:"theme neo blue",run:()=>applyTheme("neo",!0)},{label:"Theme: Mint Matrix",keywords:"theme mint green",run:()=>applyTheme("mint",!0)},{label:"Theme: Sunset Warp",keywords:"theme sunset orange",run:()=>applyTheme("sunset",!0)},{label:"Theme: Liquid Glass",keywords:"theme liquid glass apple",run:()=>applyTheme("liquidglass",!0)},{label:"Theme: Material 3",keywords:"theme material3 google",run:()=>applyTheme("material3",!0)},{label:"Theme: Paper Link",keywords:"theme paper",run:()=>applyTheme("paper",!0)},{label:"Theme: Black Flag Uprising",keywords:"theme blackflag anarchy",run:()=>applyTheme("blackflag",!0)},{label:"Mode: Toggle Matrix Rain",keywords:"matrix rain mode",run:()=>toggleMatrixMode()},{label:"Mode: Toggle Chill Music",keywords:"music chill funk mode",run:()=>toggleFunkAudio()},{label:"Mode: Toggle Elon Warp",keywords:"elon warp mode",run:()=>toggleElonMode()},{label:"Open: GitHub Profile",keywords:"github profile devxtechnic",run:()=>window.open("https://github.com/DevXtechnic","_blank","noopener,noreferrer")},{label:"Open: About Page",keywords:"about page profile",run:()=>navigateToPage("about.html")},{label:"Open: Contact Page",keywords:"contact email",run:()=>navigateToPage("contact.html")}];let t=e.slice(),n=0;const o=()=>{commandPalette.classList.add("open"),commandPalette.setAttribute("aria-hidden","false"),commandInput.value="",r(""),window.setTimeout(()=>commandInput.focus(),20)},a=()=>{commandPalette.classList.remove("open"),commandPalette.setAttribute("aria-hidden","true")},i=e=>{a(),e.run()},r=o=>{const a=o.trim().toLowerCase();if(t=a?e.filter(e=>`${e.label} ${e.keywords}`.toLowerCase().includes(a)):e.slice(),n>=t.length&&(n=0),commandResults.innerHTML="",0===t.length){const e=document.createElement("p");return e.className="command-empty",e.textContent="No command matched. Try: quiz, github, matrix, pulse.",void commandResults.appendChild(e)}t.forEach((e,t)=>{const o=document.createElement("button");o.type="button",o.className="command-item"+(t===n?" active":""),o.textContent=e.label,o.setAttribute("role","option"),o.addEventListener("click",()=>i(e)),commandResults.appendChild(o)})};paletteOpenBtn?.addEventListener("click",o),commandBackdrop?.addEventListener("click",a),commandInput.addEventListener("input",e=>{n=0,r(e.target.value)}),commandInput.addEventListener("keydown",e=>{t.length?"ArrowDown"===e.key?(e.preventDefault(),n=(n+1)%t.length,r(commandInput.value)):"ArrowUp"===e.key?(e.preventDefault(),n=(n-1+t.length)%t.length,r(commandInput.value)):"Enter"===e.key?(e.preventDefault(),i(t[n])):"Escape"===e.key&&(e.preventDefault(),a()):"Escape"===e.key&&a()}),document.addEventListener("keydown",e=>{if((e.ctrlKey||e.metaKey)&&"k"===e.key.toLowerCase())return e.preventDefault(),void(commandPalette.classList.contains("open")?a():o());"Escape"===e.key&&commandPalette.classList.contains("open")&&a()})}function initPersonaQuiz(){if(!(quizQuestion&&quizProgress&&quizOptions&&quizStartBtn&&quizResetBtn&&quizScore))return;let e=[],t=0,n=0,o=!1,a=[];const i=(i=!1)=>{(i||0===a.length)&&(a=personaQuizQuestions.map(e=>({sort:Math.random(),value:e})).sort((e,t)=>e.sort-t.sort).map(e=>e.value)),e=[],t=0,n=0,o=!1,quizQuestion.textContent="Hit start and prove your Neo-level awareness.",quizProgress.textContent=`Ready. ${personaQuizQuestions.length}-question bank loaded. ${a.length} unused.`,quizScore.textContent="Score: 0/0",quizOptions.innerHTML=""},r=()=>{const i=e[t];i&&(o=!1,quizProgress.textContent=`Question ${t+1} of ${e.length}`,quizQuestion.textContent=i.question,quizScore.textContent=`Score: ${n}/${e.length}`,quizOptions.innerHTML="",i.options.forEach((s,l)=>{const u=document.createElement("button");u.type="button",u.className="quiz-option",u.textContent=s,u.addEventListener("click",()=>{if(o)return;o=!0;l===i.answer?(n+=1,u.classList.add("good"),spawnSparks(8),showToast("Correct. Aura up.")):(u.classList.add("bad"),showToast("Wrong answer. Recovery mode."));quizOptions.querySelectorAll("button").forEach((e,t)=>{e.disabled=!0,t===i.answer&&e.classList.add("answer")}),window.setTimeout(()=>{t+=1,t>=e.length?(quizProgress.textContent=`Quiz complete. ${a.length} unused left.`,quizQuestion.textContent=n>=e.length-1?"Elite run. You know the Aura Farmer lore.":n>=3?"Solid run. You know most of the lore.":"Low aura memory. Run it again.",quizScore.textContent=`Final Score: ${n}/${e.length}`,quizOptions.innerHTML=""):r()},700)}),quizOptions.appendChild(u)}))},s=()=>{if(a.length<10)return quizProgress.textContent=`Only ${a.length} unused left. Press Reset Quiz or refresh.`,quizQuestion.textContent="Question bank exhausted for this run.",quizScore.textContent="Score: 0/0",void(quizOptions.innerHTML="");e=a.splice(0,10),t=0,n=0,r()};quizStartBtn.addEventListener("click",s),quizResetBtn.addEventListener("click",()=>i(!0)),startPersonaQuiz=()=>{scrollToSection("persona-quiz"),s()},i(!0)}initPenguinDateBadge(),initThemeSwitcher(),initNavThemeGuard(),initPageTransition(),initPageMascot(),initHeroTypewriters(),initCliSnapshotTypewriter(),initNamePronounce(),initBlackflagGunfire(),initRuntimeCompatibility(),initTerminalFontFallbackMode(),initMiniTerminal(),initCommandPalette(),initPersonaQuiz(),initAgeDisplay(),initAiConstellationTagline(),focusTerminalIfNeeded();const pendingAction=sessionStorage.getItem("neoAutoAction.v1");function launchPulse(e=null){quoteOutput&&signalCount&&(triggerHeroPulse(),launches+=1,signalCount.textContent=String(launches),quoteOutput.textContent=`> Aura pulse ${launches} launched from Mars.`,triggerPulseBackdrop(e?.clientX,e?.clientY),playPulseSound(launches),triggerPenguinPowerUp(),spawnSparks(24),"blackflag"===currentTheme&&triggerBlackflagBlast(e?.clientX||.5*window.innerWidth,e?.clientY||.5*window.innerHeight),applyPulseMilestone(launches),launches>=20&&!document.body.classList.contains("matrix-mode")&&startMatrixRain(),updateOpsDeck(`Pulse ${launches} launched`))}pendingAction&&(sessionStorage.removeItem("neoAutoAction.v1"),window.setTimeout(()=>triggerAction(pendingAction),180)),quoteBtn&"eOutput&"eBtn.addEventListener("click",()=>{const e=pickRandomQuote(quoteOutput.textContent.replace(/^>\s*/,"").trim());if(typeTextTo(quoteOutput,e,18,"> "),heroTagline){const e=heroTagline.textContent.trim(),t=heroTaglineVariants.filter(t=>t!==e),n=t[Math.floor(Math.random()*t.length)]||heroTaglineVariants[0];typeTextTo(heroTagline,n,22,"")}if("blackflag"===currentTheme){const e=quoteBtn.getBoundingClientRect();triggerBlackflagBlast(e.left+.5*e.width,e.top+.5*e.height)}resetPulseChain(),updateOpsDeck("Insight dropped")}),launchBtn&&launchBtn.addEventListener("click",launchPulse),consoleLaunchBtn?.addEventListener("click",launchPulse),consoleMatrixBtn?.addEventListener("click",()=>toggleMatrixMode());const REPO_BATCH_SIZE=6;let repoStore=[],repoRenderCount=0;function derivePulseState(e){return e<=0?"Cold start":e<5?"Warming":e<10?"Charged":e<15?"Audio online":e<20?"Warp grid":"Matrix locked"}function deriveActiveMode(){return document.body.classList.contains("matrix-mode")?"Matrix Rain":document.body.classList.contains("elon-mode")&&document.body.classList.contains("istj-mode")?"Warp + Grid":document.body.classList.contains("elon-mode")?"Elon Warp":document.body.classList.contains("istj-mode")?"ISTJ Grid":document.body.classList.contains("funk-mode")?"Chill Music":"Standard"}function updatePulseLadder(e){pulseNodes.length&&pulseNodes.forEach(t=>{const n=Number(t.dataset.target||"0");let o="idle";e>=n?o="active":n-e<=5&&(o="arming"),t.dataset.state=o})}function updateOpsDeck(e=lastOpsEvent){lastOpsEvent=e||lastOpsEvent,opsTheme&&(opsTheme.textContent=THEME_LABELS[currentTheme]||currentTheme),opsPulseState&&(opsPulseState.textContent=derivePulseState(launches)),opsActiveMode&&(opsActiveMode.textContent=deriveActiveMode()),opsLastEvent&&(opsLastEvent.textContent=lastOpsEvent),updatePulseLadder(launches)}function formatRelativeRepoUpdate(e){if(!e)return"Unknown";const t=new Date(e).getTime();if(Number.isNaN(t))return"Unknown";const n=Date.now()-t,o=Math.max(0,Math.floor(n/864e5));if(0===o)return"Updated today";if(1===o)return"Updated 1 day ago";if(o<30)return`Updated ${o} days ago`;const a=Math.floor(o/7);if(a<8)return`Updated ${a} week${1===a?"":"s"} ago`;const i=Math.floor(o/30);return`Updated ${i} month${1===i?"":"s"} ago`}function computeRepoStats(e){const t={};let n=0;e.forEach(e=>{n+=e.stargazers_count||0,e.language&&(t[e.language]=(t[e.language]||0)+1)});const o=Object.entries(t).sort((e,t)=>t[1]-e[1]).slice(0,3).map(([e])=>e);return{total:e.length,topLangs:o,totalStars:n,freshest:e[0]?.name||"Unknown"}}function updateRepoOverview(e){const t=document.getElementById("repo-total-stat"),n=document.getElementById("repo-star-stat"),o=document.getElementById("repo-top-stat"),a=document.getElementById("repo-fresh-stat");t&&(t.textContent=e?String(e.total):"--"),n&&(n.textContent=e?String(e.totalStars):"--"),o&&(o.textContent=e?.topLangs?.length?e.topLangs.join(" / "):"Mixed"),a&&(a.textContent=e?.freshest||"Unknown")}function renderRepoGrid(e=!1){const t=document.getElementById("repo-grid"),n=document.getElementById("repo-toggle"),o=document.getElementById("repo-meta-line");if(!t)return;e&&(repoRenderCount=Math.min(6,repoStore.length));const a=repoStore.slice(0,repoRenderCount);if(t.innerHTML=a.map(e=>`\n <article class="repo-card tilt">\n <h3><a href="${e.html_url}" target="_blank" rel="noopener noreferrer">${e.name}</a></h3>\n <p>${e.description||"No description yet."}</p>\n <div class="repo-chip-row" aria-label="repository metadata">\n <span class="repo-chip">${e.language||"Code"}</span>\n <span class="repo-chip">${e.stargazers_count}★</span>\n <span class="repo-chip">${e.fork?"Fork":"Source"}</span>\n </div>\n <p class="repo-meta">${formatRelativeRepoUpdate(e.updated_at)}</p>\n </article>\n `).join(""),document.querySelectorAll(".repo-card.tilt").forEach(e=>attachTiltBehavior(e)),o)if(repoStore.length){const e=computeRepoStats(repoStore),t=e.topLangs.length?` • Top languages: ${e.topLangs.join(", ")}`:"";o.textContent=`Showing ${repoRenderCount} of ${e.total} repos${t}`,updateRepoOverview(e)}else o.textContent="No public repos found yet.",updateRepoOverview(null);if(n){const e=repoRenderCount<repoStore.length;n.textContent=e?"Show more repos":"Show fewer repos",n.setAttribute("aria-expanded",e?"false":"true"),n.classList.toggle("showing-more",!e),n.style.display=repoStore.length>6?"inline-flex":"none"}}async function loadRepos(){const e=document.getElementById("repo-grid"),t=document.getElementById("repo-meta-line");if(!e)return;e.setAttribute("aria-busy","true"),t&&(t.textContent="Fetching latest repos..."),e.innerHTML=Array.from({length:6}).map(()=>'\n <div class="repo-skeleton" aria-hidden="true">\n <span class="skeleton-line title"></span>\n <span class="skeleton-line"></span>\n <span class="skeleton-line short"></span>\n </div>\n ').join("");try{const n=await fetch("https://api.github.com/users/DevXtechnic/repos?sort=updated&per_page=100");if(!n.ok)throw new Error("GitHub API request failed");const o=await n.json();if(!Array.isArray(o)||0===o.length)return e.removeAttribute("aria-busy"),e.innerHTML="<p>No public repos found yet. Check back soon.</p>",t&&(t.textContent="No public repos found yet."),void updateRepoOverview(null);repoStore=o,repoRenderCount=Math.min(6,repoStore.length),e.removeAttribute("aria-busy"),renderRepoGrid(!0)}catch(n){e.removeAttribute("aria-busy"),e.innerHTML='<p>Could not load live repos now. Visit <a href="https://github.com/DevXtechnic" target="_blank" rel="noopener noreferrer">GitHub profile</a>.</p>',t&&(t.textContent="Live repo fetch failed. Visit GitHub profile."),updateRepoOverview(null)}}function initRepoLazyLoad(){const e=document.getElementById("github-live"),t=document.getElementById("repo-grid");if(!e||!t)return;let n=!1;const o=document.getElementById("repo-toggle");o&&o.addEventListener("click",()=>{if(!repoStore.length)return;const e=repoRenderCount<repoStore.length;repoRenderCount=e?Math.min(repoRenderCount+6,repoStore.length):6,renderRepoGrid(!1)});const a=()=>{n||(n=!0,loadRepos())};if(!("IntersectionObserver"in window))return void a();const i=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(a(),i.disconnect())},{rootMargin:"0px 0px 260px 0px",threshold:.12});i.observe(e)}function renderContributionGraph(e){const t=document.getElementById("contribution-graph");if(!t)return;const n=e.weeks||[];if(!n.length)return void(t.innerHTML='<p class="contrib-error">No contribution data available.</p>');const o=12,a=Math.max(1,...n.flatMap(e=>e.days.map(e=>e.count))),i=[0,Math.ceil(.25*a),Math.ceil(.5*a),Math.ceil(.75*a),a];const r=24+13*n.length,s=getComputedStyle(document.documentElement),l=[s.getPropertyValue("--border").trim()||"#1a2640",s.getPropertyValue("--blue").trim()||"#3b82f6",s.getPropertyValue("--blue-2").trim()||"#60a5fa",s.getPropertyValue("--orange").trim()||"#f97316",s.getPropertyValue("--orange-2").trim()||"#fdba74"],u=["0.25","0.4","0.6","0.8","1"];let c='<svg class="contrib-svg" viewBox="0 0 '+r+' 145" xmlns="http://www.w3.org/2000/svg">';c+='<rect width="'+r+'" height="145" fill="transparent" rx="6"/>',n.forEach((e,t)=>{e.days.forEach((e,n)=>{if(n>6)return;const a=o+13*t,r=28+15*n,s=0===(d=e.count)?0:d<=i[1]?1:d<=i[2]?2:d<=i[3]?3:4;var d;c+='<rect x="'+a+'" y="'+r+'" width="11" height="13" rx="2" fill="'+l[s]+'" opacity="'+u[s]+'"',e.date?c+="><title>"+e.count+" contributions on "+e.date+"</title></rect>":c+="/>"})});const d=e.totalContributions||e.total||n.reduce((e,t)=>e+t.days.reduce((e,t)=>e+t.count,0),0);c+='<text x="12" y="24" fill="var(--muted)" font-size="10" font-family="Space Grotesk,sans-serif">'+d+" contributions in the last year</text>";const m=[];n.forEach((e,t)=>{const n=e.days.find(e=>e.date);if(!n)return;const o=new Date(n.date).toLocaleString("en",{month:"short"});m.length&&m[m.length-1].month===o||m.push({month:o,weekIndex:t})}),m.forEach(({month:e,weekIndex:t})=>{c+='<text x="'+(o+13*t)+'" y="143" fill="var(--muted)" font-size="9" font-family="Space Grotesk,sans-serif">'+e+"</text>"});["","Mon","","Wed","","Fri",""].forEach((e,t)=>{if(!e)return;c+='<text x="2" y="'+(28+15*t+13-2)+'" fill="var(--muted)" font-size="8" font-family="Space Grotesk,sans-serif">'+e+"</text>"}),c+="</svg>",t.innerHTML=c}async function loadContributionGraph(){const e=document.getElementById("contribution-graph");if(e)try{const e=await fetch("https://github-contributions-api.jogruber.de/v4/DevXtechnic?y=last");if(!e.ok)throw new Error("Failed to fetch");renderContributionGraph(await e.json())}catch{try{const e=await fetch("https://gh-calendar.rschristian.dev/user/DevXtechnic");if(!e.ok)throw new Error("Failed");renderContributionGraph(await e.json())}catch{e.innerHTML='<p class="contrib-error">Could not load contribution graph. <a href="https://github.com/DevXtechnic" target="_blank" rel="noopener noreferrer">View on GitHub →</a></p>'}}}function initContributionGraph(){const e=document.getElementById("contribution-section");if(!e)return;const t=()=>{loadContributionGraph()};if(!("IntersectionObserver"in window))return void t();const n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(t(),n.disconnect())},{rootMargin:"0px 0px 260px 0px",threshold:.12});n.observe(e)}function showToast(e){let t=document.querySelector(".easter-toast");t||(t=document.createElement("div"),t.className="easter-toast",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),document.body.appendChild(t)),t.textContent=e,t.classList.add("show"),window.setTimeout(()=>t.classList.remove("show"),1800)}function spawnSparks(e){const{isConstrained:t,isFirefoxLike:n,saveData:o}=runtimeFlags;if(prefersReducedMotion||o)return;const a=t?.35:n?.55:1,i=Math.max(3,Math.round(e*a)),r=document.createDocumentFragment(),s=[];for(let e=0;e<i;e+=1){const t=document.createElement("span");t.className="spark",t.style.left=98*Math.random()+"vw",t.style.setProperty("--dx",110*Math.random()-55+"px"),t.style.setProperty("--spark-delay",28*e+"ms"),r.appendChild(t),s.push(t)}document.body.appendChild(r),window.setTimeout(()=>{s.forEach(e=>e.remove())},1400+28*i)}initRepoLazyLoad(),initContributionGraph(),initFooterLineTypewriter();let matrixCanvas=null,matrixContext=null,matrixAnimation=null,matrixDrops=[],matrixResizeHandler=null,matrixViewportResizeHandler=null,matrixScrollHandler=null,matrixSize={width:0,height:0,pixelRatio:1},matrixVisibilityHandler=null,matrixDraw=null,matrixLocked=!1;function getMatrixViewportSize(){const e=window.visualViewport,t=document.documentElement;return{width:Math.max(1,Math.ceil(Math.max(window.innerWidth||0,t.clientWidth||0,e?.width||0))),height:Math.max(1,Math.ceil(Math.max(window.innerHeight||0,t.clientHeight||0,e?.height||0)))}}function startMatrixRain(e=!1){if(matrixCanvas)return document.body.classList.add("matrix-mode"),e&&(matrixLocked=!0),matrixResizeHandler?.(),void(matrixAnimation||!matrixDraw||document.hidden||matrixDraw());if(e&&(matrixLocked=!0),matrixCanvas=document.createElement("canvas"),matrixCanvas.className="matrix-layer",matrixCanvas.setAttribute("aria-hidden","true"),document.body.appendChild(matrixCanvas),matrixContext=matrixCanvas.getContext("2d"),!matrixContext)return matrixCanvas.remove(),matrixCanvas=null,matrixLocked=!1,void showToast("Matrix canvas unavailable.");matrixResizeHandler=()=>{if(!matrixCanvas||!matrixContext)return;const{width:e,height:t}=getMatrixViewportSize(),n=Math.max(1,window.devicePixelRatio||1);if(matrixSize.width===e&&matrixSize.height===t&&matrixSize.pixelRatio===n)return;matrixSize={width:e,height:t,pixelRatio:n},matrixCanvas.style.left="0px",matrixCanvas.style.top="0px",matrixCanvas.style.width=`${e}px`,matrixCanvas.style.height=`${t}px`,matrixCanvas.width=Math.floor(e*n),matrixCanvas.height=Math.floor(t*n),matrixContext.setTransform(1,0,0,1,0,0),matrixContext.clearRect(0,0,matrixCanvas.width,matrixCanvas.height),matrixContext.setTransform(n,0,0,n,0,0);const o=runtimeFlags.isConstrained?16:14,a=Math.max(18,Math.ceil(e/o)+2);matrixDrops=Array.from({length:a},()=>Math.random()*-t)},matrixResizeHandler(),requestAnimationFrame(matrixResizeHandler),window.addEventListener("resize",matrixResizeHandler),window.addEventListener("orientationchange",matrixResizeHandler),window.visualViewport&&(matrixViewportResizeHandler=()=>matrixResizeHandler?.(),window.visualViewport.addEventListener("resize",matrixViewportResizeHandler),window.visualViewport.addEventListener("scroll",matrixViewportResizeHandler,{passive:!0})),matrixScrollHandler=()=>{if(!matrixCanvas)return;const{width:e,height:t}=getMatrixViewportSize();e===matrixSize.width&&t===matrixSize.height||matrixResizeHandler?.()},window.addEventListener("scroll",matrixScrollHandler,{passive:!0});const t="01{}[]<>/\\|$#@",n=()=>{if(!matrixCanvas||!matrixContext)return;const e=Math.max(1,window.devicePixelRatio||1),o=matrixCanvas.width/e,a=matrixCanvas.height/e,i=runtimeFlags.isConstrained?16:14;matrixDrops.length||matrixResizeHandler?.(),matrixContext.globalCompositeOperation="destination-out",matrixContext.fillStyle="rgba(0, 0, 0, 0.14)",matrixContext.fillRect(0,0,o,a),matrixContext.globalCompositeOperation="source-over",matrixContext.font=(runtimeFlags.isConstrained?12:13)+"px monospace",matrixContext.textBaseline="top",matrixContext.shadowColor="rgba(115, 255, 134, 0.36)",matrixContext.shadowBlur=7,matrixDrops.forEach((e,n)=>{const o=t[Math.floor(14*Math.random())],r=n*i;matrixContext.fillStyle=Math.random()>.86?"rgba(230, 255, 235, 0.95)":"rgba(115, 255, 134, 0.92)",matrixContext.fillText(o,r,e),matrixDrops[n]=e>a&&Math.random()>.98?-Math.random()*a*.35:e+(runtimeFlags.isConstrained?8:10)}),matrixContext.shadowBlur=0,matrixAnimation=requestAnimationFrame(n)};document.body.classList.add("matrix-mode"),matrixDraw=n,n(),matrixVisibilityHandler=()=>{if(document.hidden)return matrixAnimation&&cancelAnimationFrame(matrixAnimation),void(matrixAnimation=null);document.body.classList.contains("matrix-mode")&&matrixDraw&&!matrixAnimation&&matrixDraw()},document.addEventListener("visibilitychange",matrixVisibilityHandler)}function stopMatrixRain(e=!1){!matrixLocked||e?(matrixLocked=!1,document.body.classList.remove("matrix-mode"),matrixAnimation&&cancelAnimationFrame(matrixAnimation),matrixAnimation=null,matrixDraw=null,matrixResizeHandler&&(window.removeEventListener("resize",matrixResizeHandler),window.removeEventListener("orientationchange",matrixResizeHandler),matrixResizeHandler=null),window.visualViewport&&matrixViewportResizeHandler&&(window.visualViewport.removeEventListener("resize",matrixViewportResizeHandler),window.visualViewport.removeEventListener("scroll",matrixViewportResizeHandler),matrixViewportResizeHandler=null),matrixScrollHandler&&(window.removeEventListener("scroll",matrixScrollHandler),matrixScrollHandler=null),matrixVisibilityHandler&&(document.removeEventListener("visibilitychange",matrixVisibilityHandler),matrixVisibilityHandler=null),matrixCanvas&&matrixCanvas.remove(),matrixCanvas=null,matrixContext=null,matrixDrops=[],matrixSize={width:0,height:0,pixelRatio:1}):showToast("Matrix locked. Drop Insight to reset.")}let audioCtx=null,funkTimer=null,funkStep=0,noiseBuffer=null;function ensureAudioContext(){return audioCtx||(audioCtx=new(window.AudioContext||window.webkitAudioContext)),"suspended"===audioCtx.state&&audioCtx.resume(),noiseBuffer||(noiseBuffer=buildNoiseBuffer(audioCtx)),audioCtx}const kickPattern=[1,0,0,0,1,0,0,1,1,0,0,0,1,0,1,0],snarePattern=[0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0],hatPattern=[1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0],bassPattern=[55,0,62,0,65,0,62,0,73,0,70,0,65,0,62,0];function buildNoiseBuffer(e){const t=e.createBuffer(1,.25*e.sampleRate,e.sampleRate),n=t.getChannelData(0);for(let e=0;e<n.length;e+=1)n[e]=2*Math.random()-1;return t}function playKick(e,t){const n=e.createOscillator(),o=e.createGain();n.type="sine",n.frequency.setValueAtTime(128,t),n.frequency.exponentialRampToValueAtTime(40,t+.13),o.gain.setValueAtTime(.9,t),o.gain.exponentialRampToValueAtTime(.001,t+.15),n.connect(o).connect(e.destination),n.start(t),n.stop(t+.16)}function playSnare(e,t){if(!noiseBuffer)return;const n=e.createBufferSource(),o=e.createGain(),a=e.createBiquadFilter();a.type="highpass",a.frequency.value=1800,n.buffer=noiseBuffer,o.gain.setValueAtTime(.25,t),o.gain.exponentialRampToValueAtTime(.001,t+.12),n.connect(a).connect(o).connect(e.destination),n.start(t),n.stop(t+.13)}function playHat(e,t){if(!noiseBuffer)return;const n=e.createBufferSource(),o=e.createGain(),a=e.createBiquadFilter();a.type="highpass",a.frequency.value=6200,n.buffer=noiseBuffer,o.gain.setValueAtTime(.1,t),o.gain.exponentialRampToValueAtTime(.001,t+.055),n.connect(a).connect(o).connect(e.destination),n.start(t),n.stop(t+.06)}function playBass(e,t,n){const o=e.createOscillator(),a=e.createBiquadFilter(),i=e.createGain();o.type="square",o.frequency.value=n,a.type="lowpass",a.frequency.value=280,i.gain.setValueAtTime(.13,t),i.gain.exponentialRampToValueAtTime(.001,t+.16),o.connect(a).connect(i).connect(e.destination),o.start(t),o.stop(t+.17)}function runFunkStep(){if(!audioCtx)return;const e=audioCtx.currentTime+.03,t=funkStep%16;kickPattern[t]&&playKick(audioCtx,e),snarePattern[t]&&playSnare(audioCtx,e),hatPattern[t]&&playHat(audioCtx,e);const n=bassPattern[t];n>0&&playBass(audioCtx,e,n),funkStep+=1}function startFunkAudio(){if(ensureAudioContext(),funkTimer)return;funkStep=0;funkTimer=window.setInterval(runFunkStep,125),document.body.classList.add("funk-mode")}function stopFunkAudio(){funkTimer&&(window.clearInterval(funkTimer),funkTimer=null),document.body.classList.remove("funk-mode")}function toggleFunkAudio(){funkTimer?(stopFunkAudio(),showToast("Funk reactor off."),updateOpsDeck("Chill music offline")):(startFunkAudio(),spawnSparks(22),showToast("Funk reactor online."),updateOpsDeck("Chill music online"))}function toggleISTJMode(){document.body.classList.toggle("istj-mode");const e=document.body.classList.contains("istj-mode");showToast(e?"ISTJ grid enabled.":"ISTJ grid disabled."),updateOpsDeck(e?"ISTJ grid enabled":"ISTJ grid disabled")}function toggleElonMode(){document.body.classList.toggle("elon-mode"),spawnSparks(14),showToast("Elon warp toggled."),updateOpsDeck(document.body.classList.contains("elon-mode")?"Elon warp enabled":"Elon warp disabled")}function toggleMatrixMode(){if(matrixLocked)return document.body.classList.contains("matrix-mode")||startMatrixRain(!0),showToast("Matrix locked. Drop Insight to reset."),void updateOpsDeck("Matrix locked");document.body.classList.contains("matrix-mode")?(stopMatrixRain(),showToast("Matrix rain disabled."),updateOpsDeck("Matrix rain disabled")):(startMatrixRain(),showToast("Matrix rain enabled."),updateOpsDeck("Matrix rain enabled"))}function applyPulseMilestone(e){5===e?(document.body.classList.contains("elon-mode")||toggleElonMode(),showToast("5 pulses: Elon Warp.")):10===e?(funkTimer||toggleFunkAudio(),showToast("10 pulses: Chill Music.")):15===e?(document.body.classList.contains("istj-mode")||toggleISTJMode(),showToast("15 pulses: ISTJ Grid.")):20===e&&(document.body.classList.contains("matrix-mode")||startMatrixRain(!0),showToast("20 pulses: Matrix Rain."))}function resetPulseChain(){launches=0,signalCount&&(signalCount.textContent="0"),document.body.classList.contains("elon-mode")&&document.body.classList.remove("elon-mode"),document.body.classList.contains("istj-mode")&&document.body.classList.remove("istj-mode"),document.body.classList.contains("matrix-mode")&&stopMatrixRain(!0),matrixLocked=!1,funkTimer&&stopFunkAudio(),updateOpsDeck("Pulse chain reset")}document.getElementById("funk-toggle")?.addEventListener("click",toggleFunkAudio);