/* Film Grain Effect - REMOVED */
/* Feature discontinued due to performance issues. SVG feTurbulence was too expensive. */

/* Vision 2026: Signal Spine System - Section Flow Edition */
#mm-signal-spine-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    /* Low but visible, sections have z-index: 2+ */
    overflow: visible;
}

/* Ensure all sections stack above the spine */
main>section,
#mm-site-wrapper>section,
.mm-site-wrapper>section,
section[data-tomv3] {
    position: relative;
    z-index: 2;
}

/* Path Styles */
.mm-spine-path {
    transition: stroke-dashoffset 0.15s linear;
    filter: drop-shadow(0 0 4px rgba(var(--color-signal-rgb), 0.35));
}

.mm-spine-path.mm-spine-left {
    opacity: 0.7;
}

.mm-spine-path.mm-spine-right {
    opacity: 0.4;
}

/* Node Base Styles */
.mm-spine-node {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 15;
}

/* Split Node: Where line branches */
.mm-spine-node-split {
    background: radial-gradient(circle, var(--color-signal) 30%, rgba(0, 0, 0, 0.8) 70%);
    border-color: rgba(var(--color-signal-rgb), 0.3);
}

/* Merge Node: Where lines rejoin */
.mm-spine-node-merge {
    background: radial-gradient(circle, var(--color-signal) 30%, rgba(0, 0, 0, 0.8) 70%);
    border-color: rgba(var(--color-signal-rgb), 0.3);
}

/* Active state for all nodes */
.mm-spine-node.active {
    border-color: var(--color-signal);
    background: var(--color-signal);
    box-shadow:
        0 0 20px var(--color-signal),
        0 0 40px rgba(var(--color-signal-rgb), 0.5);
    transform: translate(-50%, -50%) scale(1.2);
}

/* Section active state */
/* .mm-spine-active { } - Reserved for future use */

/* Ambient Shift Test */
body {
    transition: background-color 1s ease;
}

@keyframes mmGrainShift {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -5%);
    }

    20% {
        transform: translate(-10%, 5%);
    }

    30% {
        transform: translate(5%, -10%);
    }

    40% {
        transform: translate(-5%, 15%);
    }

    50% {
        transform: translate(-10%, 5%);
    }

    60% {
        transform: translate(15%, 0);
    }

    70% {
        transform: translate(0, 10%);
    }

    80% {
        transform: translate(-15%, 0);
    }

    90% {
        transform: translate(10%, 5%);
    }
}

/* Spotlight Glow */
.mm-spotlight-glow {
    position: fixed;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle at center, rgba(var(--color-signal-rgb), 0.03) 0%, rgba(var(--color-signal-rgb), 0) 60%);
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
    /* Behind content but in front of background */
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
}

@media (min-width: 768px) {
    .mm-spotlight-glow {
        mix-blend-mode: screen;
    }
}

/* Editorial Typography - Fluid Scale */
:root {
    --font-size-fluid-hero: clamp(3rem, 10vw, 8rem);
    --font-size-fluid-sub: clamp(1.2rem, 3vw, 2.5rem);
}

.mm-text-fluid-hero {
    font-size: var(--font-size-fluid-hero);
    line-height: 0.9;
    letter-spacing: -0.04em;
}

.mm-editorial-serif {
    font-style: italic;
    font-weight: 400;
}

/* Mobile Excellence */
body {
    overscroll-behavior-y: none;
    /* App-like feel, no bounce */
    -webkit-tap-highlight-color: transparent;
}

/* Mobile Ambient Glow (Replaces Spotlight on Touch) */
/* Mobile Ambient Glow - REMOVED for performance and z-index safety */
@media (hover: none) {
    .mm-spotlight-glow {
        display: none !important;
    }
}

@keyframes mmPulseAmbient {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }

    100% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Refined text glow (less gamer) */
.text-outline-glow-subtle {
    text-shadow: 0 0 10px rgba(var(--color-signal-rgb), 0.18);
}

.shadow-glow {
    box-shadow: 0 0 12px rgba(var(--color-signal-rgb), 0.18);
}

/* --- Vision 2026 Global Polish --- */

/* 1. Obsidian Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background: #000;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-signal);
    box-shadow: 0 0 10px var(--color-signal);
}

/* 2. Cyber-Selection Highlighting */
::selection {
    background: var(--color-signal);
    color: #000;
    text-shadow: none;
}

/* 3. Smooth Scrolling & Base */
html {
    scroll-behavior: smooth;
    cursor: default;
    /* We might add a custom cursor later */
}

/* 4. Utility: Glitch Text Effect (for 404 & Headers) */
.mm-glitch-text {
    position: relative;
}

.mm-glitch-text::before,
.mm-glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.mm-glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(44px, 450px, 56px, 0);
    animation: mmGlitchAnim 5s infinite linear alternate-reverse;
}

.mm-glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(44px, 450px, 56px, 0);
    animation: mmGlitchAnim 5s infinite linear alternate-reverse;
    animation-delay: 2s;
}

@keyframes mmGlitchAnim {
    0% {
        clip: rect(61px, 9999px, 52px, 0);
    }

    5% {
        clip: rect(33px, 9999px, 14px, 0);
    }

    10% {
        clip: rect(89px, 9999px, 16px, 0);
    }

    15% {
        clip: rect(2px, 9999px, 86px, 0);
    }

    20% {
        clip: rect(28px, 9999px, 62px, 0);
    }

    25% {
        clip: rect(54px, 9999px, 30px, 0);
    }

    30% {
        clip: rect(98px, 9999px, 6px, 0);
    }

    35% {
        clip: rect(13px, 9999px, 81px, 0);
    }

    40% {
        clip: rect(67px, 9999px, 19px, 0);
    }

    45% {
        clip: rect(46px, 9999px, 2px, 0);
    }

    50% {
        clip: rect(22px, 9999px, 88px, 0);
    }

    55% {
        clip: rect(76px, 9999px, 49px, 0);
    }

    60% {
        clip: rect(10px, 9999px, 39px, 0);
    }

    65% {
        clip: rect(59px, 9999px, 93px, 0);
    }

    70% {
        clip: rect(35px, 9999px, 25px, 0);
    }

    75% {
        clip: rect(84px, 9999px, 66px, 0);
    }

    80% {
        clip: rect(18px, 9999px, 44px, 0);
    }

    85% {
        clip: rect(95px, 9999px, 12px, 0);
    }

    90% {
        clip: rect(41px, 9999px, 73px, 0);
    }

    95% {
        clip: rect(7px, 9999px, 55px, 0);
    }

    100% {
        clip: rect(61px, 9999px, 52px, 0);
    }
}

/* ===== Floating Animations ===== */
/* Used in Hero, Portfolio, FAQ sections for decorative elements */

@keyframes floatUp {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes floatUpDelayed {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes floatUpSlow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.animate-float {
    animation: floatUp 4s ease-in-out infinite;
}

.animate-float-delayed {
    animation: floatUpDelayed 5s ease-in-out infinite;
    animation-delay: 1s;
}

.animate-float-slow {
    animation: floatUpSlow 6s ease-in-out infinite;
    animation-delay: 0.5s;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {

    .animate-float,
    .animate-float-delayed,
    .animate-float-slow {
        animation: none;
    }
}
