/* ===== MOTION SYSTEM — Framer-like Visual Effects ===== */

/* ─── Scroll Progress Bar ─── */
.scroll-progress {
 position: fixed;
 top: 0;
 left: 0;
 width: 100%;
 height: 3px;
 background: var(--blue);
 transform-origin: left;
 transform: scaleX(0);
 z-index: 9999;
 pointer-events: none;
}

/* ─── Noise Overlay ─── */
.noise-overlay {
 position: fixed;
 inset: 0;
 z-index: 9998;
 pointer-events: none;
 opacity: 0.035;
 mix-blend-mode: overlay;
 background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
 background-repeat: repeat;
 background-size: 256px 256px;
}

/* ─── Custom Cursor ─── */
.custom-cursor {
 position: fixed;
 top: 0;
 left: 0;
 pointer-events: none;
 z-index: 99999;
 border-radius: 50%;
 transform: translate(-50%, -50%);
 will-change: transform;
}

.custom-cursor--dot {
 width: 6px;
 height: 6px;
 background: var(--blue);
}

.custom-cursor--ring {
 width: 36px;
 height: 36px;
 border: 1.5px solid rgba(0, 102, 255, 0.4);
 transition: width 0.2s, height 0.2s, opacity 0.2s;
}

/* Hide default cursor on desktop when custom cursor is active */
@media (hover: hover) and (pointer: fine) {
 body:not(.reduce-motion) {
 cursor: none;
 }
 body:not(.reduce-motion) a,
 body:not(.reduce-motion) button,
 body:not(.reduce-motion) input,
 body:not(.reduce-motion) textarea,
 body:not(.reduce-motion) select,
 body:not(.reduce-motion) summary,
 body:not(.reduce-motion) [role="button"] {
 cursor: none;
 }
}

/* ─── Gradient Mesh Orbs (Hero) ─── */
.mesh-orb {
 position: absolute;
 border-radius: 50%;
 filter: blur(80px);
 opacity: 0.35;
 pointer-events: none;
 z-index: 0;
 animation: orbFloat 12s ease-in-out infinite alternate;
}

.mesh-orb--1 {
 width: 500px;
 height: 500px;
 background: radial-gradient(circle, rgba(0, 102, 255, 0.25) 0%, transparent 70%);
 top: -10%;
 right: -5%;
 animation-duration: 14s;
}

.mesh-orb--2 {
 width: 400px;
 height: 400px;
 background: radial-gradient(circle, rgba(0, 194, 255, 0.2) 0%, transparent 70%);
 bottom: 5%;
 left: -8%;
 animation-duration: 18s;
 animation-delay: -4s;
}

.mesh-orb--3 {
 width: 300px;
 height: 300px;
 background: radial-gradient(circle, rgba(141, 241, 196, 0.15) 0%, transparent 70%);
 top: 40%;
 left: 30%;
 animation-duration: 16s;
 animation-delay: -8s;
}

@keyframes orbFloat {
 0% { transform: translate(0, 0) scale(1); }
 33% { transform: translate(30px, -20px) scale(1.05); }
 66% { transform: translate(-20px, 15px) scale(0.95); }
 100% { transform: translate(10px, -10px) scale(1.02); }
}

/* ─── Tech Marquee ─── */
.tech-marquee-section {
 overflow: hidden;
 padding: 28px 0;
 border-block: 1px solid var(--line);
 background: #fafbfd;
 position: relative;
}

.tech-marquee-section::before,
.tech-marquee-section::after {
 content: '';
 position: absolute;
 top: 0;
 bottom: 0;
 width: 120px;
 z-index: 2;
 pointer-events: none;
}

.tech-marquee-section::before {
 left: 0;
 background: linear-gradient(90deg, #fafbfd 0%, transparent 100%);
}

.tech-marquee-section::after {
 right: 0;
 background: linear-gradient(-90deg, #fafbfd 0%, transparent 100%);
}

.marquee-track {
 display: flex;
 width: max-content;
 animation: marqueeScroll 40s linear infinite;
}

.marquee-content {
 display: flex;
 align-items: center;
 gap: 40px;
 padding: 0 20px;
 flex-shrink: 0;
}

.marquee-content span {
 font-family: var(--font-body);
 font-size: 13px;
 font-weight: 700;
 color: #8a9bb5;
 white-space: nowrap;
 letter-spacing: 0.04em;
 text-transform: uppercase;
 transition: color 0.3s;
}

.marquee-content span:hover {
 color: var(--blue);
}

@keyframes marqueeScroll {
 0% { transform: translateX(0); }
 100% { transform: translateX(-50%); }
}

/* Pause marquee on hover */
.tech-marquee-section:hover .marquee-track {
 animation-play-state: paused;
}

/* ─── Contact Morphing Blobs ─── */
.contact-blob {
 position: absolute;
 border-radius: 50%;
 filter: blur(60px);
 opacity: 0.2;
 pointer-events: none;
 z-index: 0;
}

.contact-blob--1 {
 width: 300px;
 height: 300px;
 background: rgba(0, 194, 255, 0.4);
 top: -20%;
 right: -10%;
 animation: blobMorph 10s ease-in-out infinite alternate;
}

.contact-blob--2 {
 width: 250px;
 height: 250px;
 background: rgba(141, 241, 196, 0.3);
 bottom: -15%;
 left: -5%;
 animation: blobMorph 14s ease-in-out infinite alternate-reverse;
}

@keyframes blobMorph {
 0% { border-radius: 50% 40% 60% 50%; transform: translate(0, 0) rotate(0deg); }
 25% { border-radius: 40% 60% 50% 55%; transform: translate(15px, -10px) rotate(5deg); }
 50% { border-radius: 55% 45% 55% 45%; transform: translate(-10px, 15px) rotate(-3deg); }
 75% { border-radius: 45% 55% 40% 60%; transform: translate(10px, 5px) rotate(4deg); }
 100% { border-radius: 60% 40% 50% 50%; transform: translate(-5px, -10px) rotate(-2deg); }
}

/* ─── Word Reveal Animation Helpers ─── */
.word-reveal {
 display: inline-block;
 overflow: hidden;
 vertical-align: bottom;
 margin-right: 0.25em;
}

.word-inner {
 display: inline-block;
 will-change: transform, opacity;
}

.line-reveal {
 display: block;
}

.char-reveal {
 will-change: transform, opacity;
}

/* ─── Reduced Motion Override ─── */
.reduce-motion .scroll-progress,
.reduce-motion .noise-overlay,
.reduce-motion .custom-cursor,
.reduce-motion .mesh-orb,
.reduce-motion .contact-blob,
.reduce-motion .marquee-track {
 display: none !important;
}

.reduce-motion * {
 animation-duration: 0.01ms !important;
 transition-duration: 0.01ms !important;
}

/* ─── Responsive Adjustments ─── */
@media (max-width: 900px) {
 .mesh-orb--1 { width: 300px; height: 300px; }
 .mesh-orb--2 { width: 250px; height: 250px; }
 .mesh-orb--3 { width: 180px; height: 180px; }

 .marquee-content { gap: 24px; }
 .marquee-content span { font-size: 11px; }

 .tech-marquee-section::before,
 .tech-marquee-section::after { width: 60px; }

 .contact-blob--1 { width: 200px; height: 200px; }
 .contact-blob--2 { width: 160px; height: 160px; }
}

@media (max-width: 680px) {
 .mesh-orb { opacity: 0.2; }
 .noise-overlay { opacity: 0.025; }
}