/* --- === Global Resets & Root Variables === --- */
:root {
        --primary-color: #8be9fd;
    --accent-color: #50fa7b;
    --accent-hot-color: #ff79c6;
    --text-color-muted: #c4cce4;
    --border-color-rgb: 68, 71, 90; /* Assuming this is (R, G, B) for var(--border-color) */
    --font-display: 'Orbitron', sans-serif;
    --font-tech: 'Electrolize', sans-serif;
    --text-heading-gradient: linear-gradient(120deg, var(--primary-color), var(--accent-color));
    --spacing-unit: 8px;
    --transition-smooth: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-elastic: 0.6s cubic-bezier(0.68, -0.6, 0.27, 1.65);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* Core Palette (Dracula Inspired & Expanded) */
    --primary-color: #8be9fd;       /* Cyan */
    --secondary-color: #bd93f9;     /* Purple */
    --accent-color: #50fa7b;        /* Green */
    --accent-hot-color: #ff79c6;    /* Pink */
    --danger-color: #ff5555;        /* Red */
    --warning-color: #f1fa8c;       /* Yellow */
    --info-color: #6272a4;          /* Dracula Comment / Blueish Grey */

    /* Backgrounds & Surfaces */
    --background-main: #191a21;     /* Even darker main bg */
    --background-deep: #0d0e12;     /* For deepest parallax */
    --surface-color: #282a36;       /* Card backgrounds, UI elements */
    --surface-color-rgb: 40, 42, 54;
    --surface-hover-color: #3a3c4e;
    --glass-bg: rgba(40, 42, 54, 0.65); /* Frosted Glass */
    --glass-border: rgba(139, 233, 253, 0.15);

    /* Text */
    --text-color: #f8f8f2;
    --text-color-muted: #c4cce4;    /* Slightly bluer muted text */
    --text-color-darker: #98a0b3;
    --text-heading-gradient: linear-gradient(120deg, var(--primary-color), var(--accent-color));

    /* Borders & Lines */
    --border-color: #44475a;
    --border-color-rgb: 68, 71, 90;
    --border-highlight: var(--primary-color);
    --border-active: var(--accent-color);

    /* Shadows */
    --shadow-color: rgba(0,0,0,0.5);
    --shadow-highlight-color: rgba(var(--accent-color-rgb, 80, 250, 123), 0.3);
    --shadow-sm: 0 3px 8px var(--shadow-color);
    --shadow-md: 0 6px 18px var(--shadow-color), 0 0 0 1px rgba(var(--border-color-rgb), 0.3);
    --shadow-lg: 0 10px 30px var(--shadow-color), 0 0 0 1px rgba(var(--accent-color-rgb), 0.2);
    --text-shadow-glow: 0 0 8px var(--shadow-highlight-color);

    /* Fonts */
    --font-primary: 'Poppins', sans-serif;
    --font-display: 'Orbitron', sans-serif;
    --font-tech: 'Electrolize', sans-serif; /* New techy font */
    --font-code: 'Roboto Mono', monospace;

    /* Transitions & Animations */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-elastic: 0.6s cubic-bezier(0.68, -0.6, 0.27, 1.65);
    --transition-long: 0.8s cubic-bezier(0.4, 0, 0.2, 1);

    /* UI Sizing & Spacing */
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;
    --spacing-unit: 8px; /* Base for margins/paddings */

    /* For color conversion to RGB for rgba() alpha */
    --primary-color-rgb: 139, 233, 253;
    --secondary-color-rgb: 189, 147, 249;
    --accent-color-rgb: 80, 250, 123;
    --accent-hot-color-rgb: 255, 121, 198;

    /* Parallax & 3D */
    --perspective-distance: 1500px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size, consider vw for hyper-responsiveness */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--surface-color);
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--surface-color); border-radius: 10px; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent-color), var(--primary-color));
    border-radius: 10px;
    border: 2px solid var(--surface-color);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--primary-color), var(--accent-hot-color)); }


body {
    font-family: var(--font-primary);
    background-color: var(--background-main);
    color: var(--text-color);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative; /* For absolute positioned elements */
    min-height: 100vh;
    perspective: var(--perspective-distance); /* For 3D effects on children */
}

/* --- === Parallax Background Layers === --- */
.parallax-bg {
    position: fixed;
    inset: 0;
    z-index: -2; /* Deepest background */
    overflow: hidden;
    pointer-events: none;
}
.bg-layer {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center center;
    will-change: transform; /* Performance hint for JS parallax */
    transition: transform 0.3s ease-out; /* For JS parallax smoothing */
}
.layer-1 { /* Deep space nebula */
    background-image: radial-gradient(ellipse at 70% 30%, rgba(var(--secondary-color-rgb),0.15) 0%, transparent 50%),
                      radial-gradient(ellipse at 30% 70%, rgba(var(--primary-color-rgb),0.1) 0%, transparent 40%),
                      url('https://www.transparenttextures.com/patterns/stardust.png'); /* Example texture */
    background-color: var(--background-deep);
    background-blend-mode: screen;
    transform: scale(1.2);
    animation: slowDrift 200s linear infinite alternate;
}
@keyframes slowDrift {
    0% { transform: scale(1.2) translate(0,0) rotate(0deg); }
    100% { transform: scale(1.25) translate(20px, -15px) rotate(5deg); }
}

.layer-2 { /* Faint tech grid */
    background-image:
        linear-gradient(rgba(var(--info-color), 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--info-color), 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.6;
    animation: gridShift 120s linear infinite;
    transform: scale(1.1);
}
@keyframes gridShift {
    0% { background-position: 0px 0px; }
    100% { background-position: 240px 120px; }
}

.layer-3 { /* Particle/starfield (CSS generated) */
    opacity: 0.8;
    /* More complex starfield */
}
.layer-3::before, .layer-3::after {
    content: "";
    position: absolute;
    inset: -200px; /* Larger to allow for movement */
    background-repeat: repeat;
    animation: starMove 60s linear infinite;
}
.layer-3::before { /* Small stars */
    background-image: radial-gradient(1px 1px at 10% 20%, var(--text-color), transparent),
                      radial-gradient(1px 1px at 50% 60%, var(--text-color-muted), transparent),
                      radial-gradient(1px 1px at 80% 30%, var(--primary-color), transparent);
    background-size: 200px 200px; /* Density */
    opacity: 0.7;
}
.layer-3::after { /* Slightly larger/brighter stars */
    background-image: radial-gradient(2px 2px at 30% 80%, var(--accent-color), transparent),
                      radial-gradient(1.5px 1.5px at 70% 10%, var(--secondary-color), transparent);
    background-size: 300px 300px;
    animation-direction: reverse;
    animation-duration: 90s;
    opacity: 0.9;
}
@keyframes starMove {
    from { transform: translate(0, 0); }
    to { transform: translate(-200px, 100px); } /* Adjust movement range */
}

.layer-4 { /* Animated Scanlines / Noise Overlay */
    background:
        repeating-linear-gradient(
            var(--background-main) 0px,
            var(--background-main) 2px,
            transparent 2px,
            transparent 4px
        );
    opacity: 0.05;
    animation: scanlines 30s linear infinite;
    pointer-events: none;
    z-index: -1; /* Above other bg layers but below content */
}
@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 -100px; } /* Speed of scanlines */
}
body::after { /* Global noise overlay */
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.025; /* Very subtle */
    pointer-events: none;
    z-index: 9998; /* High, but below cursor */
    animation: noiseAnim 0.5s steps(2) infinite;
}
@keyframes noiseAnim {
    0% { transform: translate(0,0); }
    25% { transform: translate(-1px,1px); }
    50% { transform: translate(1px,-1px); }
    75% { transform: translate(1px,1px); }
    100% { transform: translate(0,0); }
}


/* --- === Main Container & Layout === --- */
.container-wrapper {
    perspective: 2000px; /* Perspective for the main container's 3D hover effect */
}
.container {
    max-width: 1000px; /* Slightly wider */
    width: 90%;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 3);
    position: relative;
    z-index: 1;
        opacity: 0;
    transform: translateY(30px); /* Or your preferred entry transform */
    animation: dropInContainer 1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    animation-delay: 0.1s; /* Short delay for container itself */
}
@keyframes dropInContainer {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- === Site Header Section === --- */
.site-header {
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 7); /* Adjusted from 8 */
    padding: calc(var(--spacing-unit) * 3) 0;    /* Adjusted from 4 */
    position: relative;
    border-bottom: 1px solid rgba(var(--border-color-rgb), 0.25); /* Slightly more visible */
}

/* Decorative lines for the header border */
.site-header::before,
.site-header::after {
    content: '';
    position: absolute;
    height: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color); /* Soft glow */

    /* Initial State (for animation) */
    opacity: 0;
    width: 0;

    animation: drawHeaderLine 1.2s var(--transition-smooth) forwards;
}

.site-header::before {
    top: -1px; /* Position on the border */
    left: 0;
    animation-delay: 0.3s; /* Start after container begins appearing */
}

.site-header::after {
    bottom: -1px; /* Position on the border */
    right: 0;
    animation-delay: 0.4s; /* Slightly after the first line */
}

@keyframes drawHeaderLine {
    to {
        width: 30%; /* How far the line draws in */
        opacity: 0.8;
    }
}

/* Logo Container and Characters ("AB") */
.logo-container.animated-logo {
    display: inline-flex; /* Aligns characters side-by-side */
    margin-bottom: calc(var(--spacing-unit) * 1.5); /* Space below logo */
}

.header-logo-char {
    font-family: var(--font-display);
    font-size: 2.8rem; /* Slightly larger */
    color: var(--primary-color);
    font-weight: 900;
    text-shadow: 0 0 12px var(--primary-color), 0 0 6px #fff; /* Enhanced glow */
    padding: 0 3px; /* Spacing between A and B */
    display: inline-block;
    transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease;

    /* Initial State (for animation) */
    opacity: 0;
    transform: translateY(-25px) rotateY(90deg) scale(0.8);

    animation: flipInLogoChar 0.7s var(--transition-elastic) forwards;
    /* Staggered animation delay, starting after header lines */
    animation-delay: calc(0.5s + var(--i) * 0.18s); /* --i is 0 for A, 1 for B from HTML */
}

.header-logo-char:hover {
    color: var(--accent-hot-color);
    text-shadow: 0 0 18px var(--accent-hot-color), 0 0 10px #fff;
    transform: scale(1.15) rotateZ(3deg) translateY(-2px); /* More playful hover */
}

@keyframes flipInLogoChar {
    to {
        opacity: 1;
        transform: translateY(0) rotateY(0deg) scale(1);
    }
}

/* Main Title ("Abhinit Barua") */
.main-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 4.8rem); /* Slightly larger clamp */
    font-weight: 900;
    letter-spacing: 2.5px; /* Slightly more spacing */
    margin-bottom: calc(var(--spacing-unit) * 1.5); /* Space below title */
    position: relative; /* For any potential future pseudo-elements */

    /* Gradient Text */
    background: var(--text-heading-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent; /* Fallback for browsers not supporting -webkit prefix */

    /* Initial State (for animation) */
    opacity: 0;
    transform: translateY(20px) scale(0.95);

    animation: mainTitleReveal 1s var(--transition-smooth) forwards;
    animation-delay: 0.8s; /* Start after logo characters are mostly in */
}
/* The span inside main-title is optional if only for glitch. If kept for other reasons: */
.main-title > span {
    display: inline-block; /* Useful if you add transforms or other effects directly to span */
}

@keyframes mainTitleReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Subtitle ("Digital Architect & Tech Innovator") */
.sub-title {
    font-family: var(--font-tech);
    font-size: 1.25rem; /* Slightly larger */
    color: var(--text-color-muted);
    letter-spacing: 1.5px; /* More spacing */
    margin-bottom: calc(var(--spacing-unit) * 4);
    text-transform: uppercase;

    /* Initial State (for animation) */
    opacity: 0;
    transform: translateY(15px);

    animation: subTitleReveal 1s var(--transition-smooth) forwards;
    animation-delay: 1.0s; /* Start after main title is mostly in */
}
/* Optional decorative elements for subtitle if desired */
.sub-title::before,
.sub-title::after {
    content: "//"; /* Or any other character like "[ " and " ]" */
    color: var(--accent-color);
    opacity: 0.7;
    margin: 0 10px; /* Space around the text */
    font-weight: normal; /* Don't make it too bold */
}

@keyframes subTitleReveal {
    to {
        opacity: 0.9; /* Slightly less than full opacity for subtlety */
        transform: translateY(0);
    }
}

/* Main Navigation */
.main-nav {
    margin-top: calc(var(--spacing-unit) * 2); /* Add some space above nav */
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 1.5); /* Space between nav items */
    flex-wrap: wrap; /* Allow nav items to wrap on smaller screens */

    /* Initial State (for animation) */
    opacity: 0;
    transform: translateY(15px);

    animation: navReveal 1s var(--transition-smooth) forwards;
    animation-delay: 1.2s; /* Start after subtitle is mostly in */
}

@keyframes navReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-link {
    font-family: var(--font-tech);
    text-decoration: none;
    color: var(--text-color-muted);
    font-weight: 600; /* Was 700, can adjust */
    font-size: 1.1em; /* Consistent size */
    padding: 12px 18px; /* Padding around text */
    position: relative; /* For the ::after pseudo-element and .nav-link-deco */
    display: inline-block; /* Ensures padding and ::after work correctly */
    overflow: hidden; /* If using complex bg animations on hover */
    border-radius: var(--border-radius-sm); /* Subtle rounding */
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.nav-link span { /* The text itself */
    position: relative;
    z-index: 1; /* Above .nav-link-deco */
    display: inline-block; /* For potential transforms on text */
}

.nav-link .nav-link-deco { /* The underline/shape effect */
    position: absolute;
    z-index: 0;
    bottom: 6px; /* Position from bottom */
    left: 50%;
    transform: translateX(-50%); /* Center it */
    width: 0%; /* Initial width for animation */
    height: 2.5px; /* Thickness */
    background: var(--accent-color);
    border-radius: 1px;
    box-shadow: 0 0 7px var(--accent-color);
    transition: width 0.4s var(--transition-smooth), background-color 0.3s var(--transition-smooth);
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active { /* .active class can be added by JS for current page */
    color: var(--text-color); /* Brighter text on hover/focus */
    transform: translateY(-3px); /* Slight lift */
}

.nav-link:hover .nav-link-deco,
.nav-link:focus .nav-link-deco,
.nav-link.active .nav-link-deco {
    width: calc(100% - 24px); /* Make underline slightly shorter than text padding */
    background: var(--accent-hot-color); /* Change color on hover */
    box-shadow: 0 0 10px var(--accent-hot-color);
}

.nav-link:active span {
    transform: translateY(1px); /* Slight press down effect */
}


/* --- === Main Content & Sections === --- */
main {
    margin-top: calc(var(--spacing-unit) * 5);
}

/* --- === Cards (ULTRA ENHANCED) === --- */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%) brightness(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.1);
    padding: 0; /* Padding will be on card-content-wrapper */
    margin-bottom: calc(var(--spacing-unit) * 7);
    border-radius: var(--border-radius-xl); /* Larger radius for softer look */
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: visible; /* Needed for 3D tilt content to not be clipped by parent */
    transform-style: preserve-3d; /* For 3D effects on children */
    transition: transform 0.8s var(--transition-elastic), box-shadow 0.5s var(--transition-smooth);
    will-change: transform, box-shadow;
}
.card-3d-wrapper { /* This element will tilt */
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 5);
    transform-style: preserve-3d;
    transform: translateZ(0); /* Ensure it's on its own layer */
    transition: transform 0.4s var(--transition-smooth);
    position: relative; /* For stacking context of internal elements */
    border-radius: inherit; /* Inherit parent's border radius */
    overflow: hidden; /* Clip internal effects like glow, animated border */
}
.interactive-card:hover {
    /* transform: translateY(-10px) scale(1.01) rotateX(2deg) rotateY(1deg); */ /* Main card container subtle lift */
    box-shadow: var(--shadow-lg), 0 0 50px rgba(var(--accent-color-rgb),0.1);
}
/* JS will apply mouse-move transform to .card-3d-wrapper */
/*
.interactive-card:hover .card-3d-wrapper {
    transform: translateZ(40px) rotateX(var(--card-rotate-x)) rotateY(var(--card-rotate-y));
}
*/

.card-border-animated { /* Animated border using pseudo-elements */
    position: absolute;
    inset: -2px; /* Slightly outside to make border appear on edge */
    border-radius: inherit;
    z-index: -1; /* Behind content */
    overflow: hidden;
}
.card-border-animated::before {
    content: "";
    position: absolute;
    width: 200%; height: 200%;
    top: -50%; left: -50%;
    background: conic-gradient(
        from var(--angle, 0deg),
        transparent 0%,
        transparent 30%,
        var(--accent-hot-color) 48%,
        var(--accent-color) 52%,
        transparent 70%,
        transparent 100%
    );
    animation: rotateBorderFull 8s linear infinite paused;
    will-change: transform;
}
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes rotateBorderFull { to { --angle: 360deg; } }

.interactive-card:hover .card-border-animated::before {
    animation-play-state: running;
}

.card-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 0; /* Above border, below content */
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y),
                                rgba(var(--accent-color-rgb), 0.2) 0%,
                                rgba(var(--accent-color-rgb), 0.08) 25%,
                                transparent 60%);
    will-change: opacity;
}
.interactive-card:hover .card-glow { opacity: 1; }

.card-background-pattern { /* Subtle pattern inside card, behind content */
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image:
        linear-gradient(45deg, rgba(var(--primary-color-rgb), 0.02) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(var(--primary-color-rgb), 0.02) 25%, transparent 25%);
    background-size: 20px 20px;
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

.card-content-wrapper {
    position: relative; /* Stacking context for content */
    z-index: 1;
    transform: translateZ(20px); /* Lift content slightly within the 3D space */
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin-bottom: calc(var(--spacing-unit) * 3.5);
    padding-bottom: calc(var(--spacing-unit) * 1.5);
    position: relative;
    display: inline-block;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: transparent; /* Text will be shown by pseudo-elements */
    transform: translateZ(10px); /* Further lift for title */
}
.section-title span { /* Actual text for accessibility & base color */
    position: relative;
    z-index: 2; /* Above other pseudo-elements */
    background: var(--text-heading-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}
.section-title::before { /* Solid background for text, slightly offset for effect */
    content: attr(data-content);
    position: absolute;
    left: 0; top: 0;
    z-index: 1; /* Behind span, above ::after */
    color: var(--surface-hover-color); /* Darker text for depth */
    text-shadow: 1px 1px 0px rgba(var(--background-main), 0.5);
    transform: translate(-2px, -2px);
    transition: transform var(--transition-smooth);
}
.section-title::after { /* Animated underline/accent */
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hot-color));
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-color), 0 0 5px var(--accent-hot-color);
    transition: width var(--transition-elastic) 0.1s;
}
.card:hover .section-title::after, .card:focus-within .section-title::after {
    width: 100%;
}
.card:hover .section-title::before {
    transform: translate(2px, 2px) skew(-3deg);
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color);
}

.text-flow { /* Enhanced paragraph styling */
    font-size: 1.1rem;
    color: var(--text-color-muted);
    margin-bottom: calc(var(--spacing-unit) * 2.5);
    line-height: 1.85;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    opacity: 0.9;
    transition: color var(--transition-smooth), opacity var(--transition-smooth);
}
.card:hover .text-flow {
    color: var(--text-color);
    opacity: 1;
}
.text-flow strong {
    color: var(--primary-color);
    font-weight: 600;
    text-shadow: 0 0 3px rgba(var(--primary-color-rgb),0.3);
}
.text-flow a { /* Links within text */
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    background-image: linear-gradient(var(--accent-color), var(--accent-color));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px; /* Underline width */
    transition: background-size var(--transition-smooth), color var(--transition-fast);
}
.text-flow a:hover {
    color: var(--accent-hot-color);
    background-size: 100% 1px;
    background-image: linear-gradient(var(--accent-hot-color), var(--accent-hot-color));
}

.decorative-lines {
    display: flex;
    justify-content: flex-start;
    margin-top: calc(var(--spacing-unit) * 3);
    gap: var(--spacing-unit);
}
.decorative-lines span {
    display: block;
    height: 2px;
    background: var(--border-color);
    border-radius: 1px;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    animation: drawDecorativeLine 0.8s var(--transition-smooth) forwards;
    animation-delay: var(--delay, 0s); /* Stagger with JS or inline style */
}
.decorative-lines span:nth-child(1) { width: 60px; }
.decorative-lines span:nth-child(2) { width: 40px; background: var(--accent-color); }
.decorative-lines span:nth-child(3) { width: 20px; }
.card:hover .decorative-lines span { animation-play-state: running; /* Re-run on hover if desired */ }
@keyframes drawDecorativeLine {
    to { opacity: 0.7; transform: scaleX(1); }
}

.decorative-circuit {
    width: 100%;
    height: 50px; /* Adjust as needed */
    margin-top: calc(var(--spacing-unit) * 3);
}
.circuit-path {
    stroke-dasharray: 500; /* Total length of path (estimate or measure) */
    stroke-dashoffset: 500;
    animation: drawCircuit 3s var(--transition-elastic) forwards 0.5s; /* Delay animation */
}
.card:hover .circuit-path {
    animation: drawCircuit 3s var(--transition-elastic) forwards, pulseCircuit 2s infinite linear 3s;
}
@keyframes drawCircuit {
    to { stroke-dashoffset: 0; }
}
@keyframes pulseCircuit {
    0%, 100% { stroke: var(--accent-color); opacity: 0.8; filter: drop-shadow(0 0 3px var(--accent-color));}
    50% { stroke: var(--primary-color); opacity: 1; filter: drop-shadow(0 0 6px var(--primary-color));}
}


/* --- === Buttons (ULTRA ENHANCED) === --- */
.button-group {
    display: flex;
    gap: calc(var(--spacing-unit) * 2.5);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: calc(var(--spacing-unit) * 3.5);
}

.btn {
    padding: 15px 35px; /* Larger padding */
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-tech);
    font-weight: 700;
    font-size: 1.1em;
    letter-spacing: 1px;
    transition: all var(--transition-smooth);
    border: 2px solid transparent;
    cursor: pointer; /* Use custom cursor */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transform: translateZ(5px); /* Slightly lift buttons */
    will-change: transform, box-shadow, border-color, color;
}
.btn span { position: relative; z-index: 2; /* Above glare and particles */ }

.futuristic-btn {
    background: linear-gradient(145deg, var(--surface-hover-color), var(--surface-color));
    border-color: var(--border-color);
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.4);
}
.futuristic-btn::before, .futuristic-btn::after { /* Corner accents - more dynamic */
    content: '';
    position: absolute;
    width: 0px; height: 0px;
    opacity: 0;
    transition: all var(--transition-smooth) 0.1s;
    border-style: solid;
    border-color: var(--accent-color);
}
.futuristic-btn::before {
    top: 0; left: 0;
    border-width: 0;
}
.futuristic-btn::after {
    bottom: 0; right: 0;
    border-width: 0;
}

.futuristic-btn:hover, .futuristic-btn:focus {
    transform: translateY(-4px) translateZ(15px) scale(1.03);
    box-shadow: 0 8px 20px rgba(var(--accent-color-rgb), 0.25), var(--shadow-md);
    border-color: var(--accent-color);
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.6);
}
.futuristic-btn:hover::before, .futuristic-btn:focus::before {
    width: 15px; height: 15px;
    opacity: 1;
    border-width: 2px 0 0 2px; /* Top-left */
}
.futuristic-btn:hover::after, .futuristic-btn:focus::after {
    width: 15px; height: 15px;
    opacity: 1;
    border-width: 0 2px 2px 0; /* Bottom-right */
}

.btn-glare {
    position: absolute;
    top: -75%; left: -150%;
    width: 80px; /* Wider glare */
    height: 250%;
    background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    transform: rotate(30deg);
    transition: left var(--transition-elastic) 0.1s;
    z-index: 1;
}
.futuristic-btn:hover .btn-glare, .futuristic-btn:focus .btn-glare {
    left: 150%;
    transition: left var(--transition-elastic);
}

.btn-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.btn-particles i { /* Particle elements */
    position: absolute;
    background-color: var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    animation: particleBurst 0.8s ease-out forwards;
    will-change: transform, opacity;
}
/* JS will randomize positions and delays for particles on hover */
.futuristic-btn:hover .btn-particles i:nth-child(1) { top: 20%; left: 30%; width: 3px; height: 3px; animation-delay: 0s; }
.futuristic-btn:hover .btn-particles i:nth-child(2) { top: 50%; left: 70%; width: 2px; height: 2px; animation-delay: 0.1s; }
/* ... (more particles, up to 8 as in HTML) ... */
.futuristic-btn:hover .btn-particles i:nth-child(8) { top: 80%; left: 40%; width: 3px; height: 3px; animation-delay: 0.35s; background-color: var(--accent-hot-color); }

@keyframes particleBurst {
    0% { transform: scale(0) translate(0,0); opacity: 1; }
    100% { transform: scale(1) translate(var(--tx, 0px), var(--ty, 0px)); opacity: 0; }
    /* JS would set --tx and --ty for random outward movement */
}


.btn-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    text-shadow: 0 0 8px rgba(var(--secondary-color-rgb), 0.4);
}
.btn-secondary::before, .btn-secondary::after { border-color: var(--secondary-color); }
.btn-secondary:hover, .btn-secondary:focus {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    box-shadow: 0 8px 20px rgba(var(--secondary-color-rgb), 0.25), var(--shadow-md);
    text-shadow: 0 0 10px rgba(var(--secondary-color-rgb), 0.6);
}
.btn-secondary .btn-particles i { background-color: var(--secondary-color); }
.btn-secondary .btn-particles i:nth-child(odd) { background-color: var(--primary-color); }


/* --- === Social Links (ULTRA ENHANCED) === --- */
.social-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 2.5);
    padding-top: var(--spacing-unit);
    margin-top: var(--spacing-unit);
}
.social-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px; height: 55px; /* Slightly larger */
    text-decoration: none;
    color: var(--text-color-muted);
    background-color: transparent; /* Will use pseudo-element for bg */
    border-radius: 50%;
    border: 2px solid rgba(var(--border-color-rgb), 0.4);
    transition: all var(--transition-smooth);
    position: relative;
    box-shadow: var(--shadow-sm);
    transform: translateZ(5px);
}
.social-icon-link::before { /* Background fill effect */
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: var(--surface-color);
    opacity: 0.8;
    transform: scale(0.8);
    transition: transform var(--transition-smooth), background-color var(--transition-smooth), opacity var(--transition-smooth);
    z-index: -1;
}
.social-icon-link i {
    font-size: 1.6em;
    transition: transform var(--transition-elastic), color var(--transition-fast);
    position: relative; z-index: 1;
}
.social-icon-link:hover, .social-icon-link:focus {
    transform: translateY(-6px) translateZ(15px) scale(1.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.35);
    border-color: var(--accent-color); /* Default hover border */
}
.social-icon-link:hover::before, .social-icon-link:focus::before {
    transform: scale(1);
    opacity: 1;
    background-color: var(--surface-hover-color);
}
.social-icon-link:hover i, .social-icon-link:focus i {
    transform: scale(1.15) rotateZ(10deg);
    color: var(--accent-color); /* Default hover icon */
}

/* Specific Social Icon Hover Colors (More Vivid) */
.social-icon-link[aria-label="GitHub"]:hover, .social-icon-link[aria-label="GitHub"]:focus { border-color: #e4e4e4; i { color: #e4e4e4; } }
.social-icon-link[aria-label="Discord"]:hover, .social-icon-link[aria-label="Discord"]:focus { border-color: #5865F2; i { color: #5865F2; } }
.social-icon-link[aria-label="Email"]:hover, .social-icon-link[aria-label="Email"]:focus { border-color: #EA4335; i { color: #EA4335; } }
.social-icon-link[aria-label="Reddit"]:hover, .social-icon-link[aria-label="Reddit"]:focus { border-color: #FF4500; i { color: #FF4500; } }
.social-icon-link[aria-label="GitLab"]:hover, .social-icon-link[aria-label="GitLab"]:focus { border-color: #FC6D26; i { color: #FC6D26; } }

.tooltip {
    position: absolute;
    bottom: calc(100% + 12px); /* Further up */
    left: 50%;
    transform: translateX(-50%) translateY(5px) scale(0.8);
    background-color: var(--surface-hover-color);
    color: var(--text-color);
    padding: 8px 15px; /* More padding */
    border-radius: var(--border-radius-md);
    font-size: 0.9em; font-family: var(--font-tech);
    white-space: nowrap;
    opacity: 0; visibility: hidden;
    transition: opacity var(--transition-fast), transform var(--transition-fast) var(--transition-fast), visibility 0s var(--transition-fast);
    pointer-events: none;
    box-shadow: var(--shadow-md);
    z-index: 100;
    border: 1px solid var(--border-color);
}
.tooltip::after { /* Tooltip arrow */
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    margin-left: -6px; /* Centered arrow */
    border-width: 6px;
    border-style: solid;
    border-color: var(--surface-hover-color) transparent transparent transparent;
}
.social-icon-link:hover .tooltip, .social-icon-link:focus .tooltip {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0px) scale(1);
    transition-delay: 0s, 0s, 0s; /* Ensure visibility transition is immediate on show */
}

/* --- === Placeholder Sections (Enhanced Styling) === --- */
.placeholder-section {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.placeholder-section .card-3d-wrapper {
    /* Potentially add unique perspective origin for placeholder sections */
}
.placeholder-section p.text-flow {
    font-style: normal; /* Remove italic if using text-flow */
    color: var(--text-color-muted);
    font-size: 1.2em;
    max-width: 75%;
    margin-top: var(--spacing-unit);
}

.project-grid-placeholder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 2.5);
    width: 100%;
    margin-top: calc(var(--spacing-unit) * 3);
}
.project-item-placeholder {
    background-color: rgba(var(--surface-color-rgb), 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-tech);
    color: var(--text-color-darker);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    cursor: pointer;
}
.project-item-placeholder:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.project-item-placeholder .item-glow {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(var(--accent-color-rgb),0.2), transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}
.project-item-placeholder:hover .item-glow { opacity: 1; }
.project-item-placeholder span { z-index: 1; }

.skills-bars-placeholder {
    width: 100%;
    max-width: 600px;
    margin-top: calc(var(--spacing-unit) * 3);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2.5);
}
.skill-bar-placeholder {
    font-family: var(--font-tech);
}
.skill-name-placeholder {
    display: block;
    margin-bottom: var(--spacing-unit);
    color: var(--text-color-muted);
    font-size: 1em;
    text-align: left;
}
.skill-level-bg {
    height: 12px;
    background-color: rgba(var(--border-color-rgb), 0.3);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid rgba(var(--border-color-rgb), 0.5);
}
.skill-level-fill {
    height: 100%;
    width: 0%; /* Animated by JS or .is-visible */
    background: linear-gradient(90deg, var(--skill-color, var(--accent-color)), lighten(var(--skill-color, var(--accent-color)), 15%));
    border-radius: var(--border-radius-sm);
    transition: width 1.5s var(--transition-elastic) 0.2s; /* Staggered transition */
    box-shadow: 0 0 8px var(--skill-color, var(--accent-color));
}
.dynamic-reveal.is-visible .skill-level-fill { /* Animate when section is visible */
    width: var(--skill-level, 0%);
}

.matrix-bg-v2 { /* Enhanced Matrix background */
    position: absolute; inset: 0;
    overflow: hidden; z-index: 0; /* Behind card content */
    border-radius: inherit;
    pointer-events: none;
    background-color: rgba(var(--background-main), 0.5); /* Darken the area */
}
.matrix-bg-v2 canvas { /* JS will create this canvas */
    position: absolute; inset: 0;
    opacity: 0.15; /* Subtle effect */
}


/* --- === Footer (ULTRA ENHANCED) === --- */
.site-footer-enhanced {
    text-align: left; /* Change from center for grid */
    margin-top: calc(var(--spacing-unit) * 10);
    padding: calc(var(--spacing-unit) * 6) 0 calc(var(--spacing-unit) * 3) 0;
    color: var(--text-color-muted);
    border-top: 1px solid rgba(var(--border-color-rgb), 0.2);
    background: linear-gradient(to top, rgba(var(--surface-color-rgb), 0.2), transparent);
    position: relative;
    font-size: 0.95em;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 4);
    max-width: 1100px;
    margin: 0 auto calc(var(--spacing-unit) * 4) auto;
    padding: 0 calc(var(--spacing-unit) * 2);
}
.footer-column h4 {
    font-family: var(--font-display);
    color: var(--primary-color);
    font-size: 1.3em;
    margin-bottom: calc(var(--spacing-unit) * 2);
    letter-spacing: 1px;
}
.footer-column p {
    margin-bottom: var(--spacing-unit);
    line-height: 1.6;
}
.footer-tagline { font-style: italic; color: var(--text-color-darker); }
.pulse-heart, .footer-column .fa-brain, .footer-column .fa-mug-hot {
    color: var(--accent-hot-color);
    animation: pulseIcon 1.5s infinite ease-in-out;
    display: inline-block; /* For transform */
}
.footer-column .fa-brain { animation-delay: 0.2s; color: var(--primary-color); }
.footer-column .fa-mug-hot { animation-delay: 0.4s; color: var(--warning-color); }
@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.footer-nav { list-style: none; }
.footer-nav li a {
    color: var(--text-color-muted);
    text-decoration: none;
    padding: 5px 0;
    display: inline-block;
    position: relative;
    font-family: var(--font-tech);
    transition: color var(--transition-fast), transform var(--transition-fast);
}
.footer-nav li a::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 0%; height: 1px;
    background: var(--accent-color);
    transition: width var(--transition-smooth);
}
.footer-nav li a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}
.footer-nav li a:hover::after { width: 100%; }

.footer-socials { display: flex; gap: var(--spacing-unit) * 1.5; }
.footer-socials a {
    color: var(--text-color-muted);
    font-size: 1.5em;
    transition: color var(--transition-fast), transform var(--transition-fast);
}
.footer-socials a:hover {
    color: var(--primary-color);
    transform: scale(1.2) rotate(-10deg);
}

.footer-bottom-bar {
    border-top: 1px solid rgba(var(--border-color-rgb), 0.1);
    padding: calc(var(--spacing-unit) * 2.5) calc(var(--spacing-unit) * 2);
    text-align: center;
    font-size: 0.85em;
    color: var(--text-color-darker);
    font-family: var(--font-code);
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}
.status-online {
    color: var(--accent-color);
    font-weight: bold;
    text-shadow: 0 0 5px var(--accent-color);
}
.scroll-to-top-btn {
    background-color: rgba(var(--accent-color-rgb), 0.1);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    width: 45px; height: 45px;
    display: inline-flex; /* Changed from flex */
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2em;
    transition: all var(--transition-smooth);
    box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.3);
    position: relative; /* For span */
}
.scroll-to-top-btn span {
    font-size: 0.6em;
    position: absolute;
    bottom: -18px;
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    transform: translateY(5px);
    font-family: var(--font-tech);
}
.scroll-to-top-btn:hover {
    background-color: var(--accent-color);
    color: var(--background-main);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb), 0.5);
}
.scroll-to-top-btn:hover span {
    opacity: 1;
    transform: translateY(0);
}
.scroll-to-top-btn .fa-angle-double-up {
    animation: bounceArrow 1.5s infinite ease-in-out;
}
@keyframes bounceArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}


/* --- === Animations & Utility Classes === --- */
.dynamic-reveal { /* For Intersection Observer */
    opacity: 0;
    transform: translateY(40px) scale(0.98) rotateX(-5deg);
    transform-origin: center bottom;
    transition: opacity 0.8s var(--transition-smooth), transform 1s var(--transition-elastic);
    transition-delay: 0.1s; /* Slight delay for staggered effect if multiple are revealed */
}
.dynamic-reveal.is-visible {
    opacity: 1;
    transform: translateY(0px) scale(1) rotateX(0deg);
}

/* --- Responsive Design (Refinements) --- */
@media (max-width: 1024px) {
    .container { width: 95%; }
    .card-3d-wrapper { padding: calc(var(--spacing-unit) * 3.5) calc(var(--spacing-unit) * 4); }
    .footer-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

@media (max-width: 768px) {
    html { font-size: 15px; }
    .main-title { font-size: clamp(2rem, 10vw, 3.5rem); }
    .sub-title { font-size: 1rem; }
    .nav-link { padding: 10px 15px; font-size: 1em; }
    .card { margin-bottom: calc(var(--spacing-unit) * 6); }
    .card-3d-wrapper { padding: calc(var(--spacing-unit) * 3); }
    .section-title { font-size: clamp(1.8rem, 6vw, 2.4rem); }
    .text-flow { font-size: 1.05rem; }
    .button-group { flex-direction: column; align-items: center; gap: var(--spacing-unit) * 2; }
    .btn { width: 80%; max-width: 350px; padding: 14px 30px; font-size: 1em; }
    .social-icon-link { width: 50px; height: 50px; }
    .footer-grid { gap: calc(var(--spacing-unit) * 3); }
    .footer-bottom-bar { flex-direction: column; gap: var(--spacing-unit); text-align: center; }
    .scroll-to-top-btn { /* position: fixed; bottom: 20px; right: 20px; z-index: 100; */ /* If needed for mobile */ }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    body { cursor: auto; } /* Disable custom cursor on small touch devices */
    .cursor-dot, .cursor-ring { display: none; }
    .container { padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2); }
    .main-title { letter-spacing: 1px; }
    .card-3d-wrapper { padding: calc(var(--spacing-unit) * 2.5); }
    .section-title { margin-bottom: calc(var(--spacing-unit) * 2.5); }
    .btn { width: 90%; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-column h4 { text-align: center; }
    .footer-nav { text-align: center; }
    .footer-socials { justify-content: center; }
}

/* --- Accessibility: Focus visible --- */
:focus-visible {
    outline: 3px dashed var(--accent-hot-color);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(var(--accent-hot-color-rgb), 0.3);
    border-radius: var(--border-radius-sm);
}
.btn:focus-visible, .social-icon-link:focus-visible, .nav-link:focus-visible, .scroll-to-top-btn:focus-visible {
    outline: none; /* Custom focus already applied or will be through hover styles */
}

/* ... (Your existing 3000+ lines of CSS) ... */

/* 21. UNBELIEVABLE MUSIC PLAYER CONTROLS
-------------------------------------------------- */
.music-player-controls {
    position: fixed;
    bottom: var(--spacing-lg); /* 32px */
    right: var(--spacing-lg);  /* 32px */
    z-index: var(--z-modal); /* High z-index to be on top */
    display: flex;
    align-items: center;
    background-color: rgba(var(--surface-color-rgb), 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-pill);
    padding: var(--spacing-xs); /* 4px */
    box-shadow: var(--shadow-lg), 0 0 0 2px rgba(var(--primary-color-rgb), 0.3);
    transition: all var(--transition-medium);
    transform: translateX(150%); /* Start off-screen */
    animation: slideInMusicControls 1s 2s forwards cubic-bezier(0.165, 0.84, 0.44, 1); /* Delay appearance */
}

@keyframes slideInMusicControls {
    to {
        transform: translateX(0);
    }
}

.music-player-controls:hover {
    box-shadow: var(--shadow-lg), 0 0 10px 3px rgba(var(--primary-color-rgb), 0.7);
    transform: scale(1.05);
}

.music-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: var(--text-on-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2), 0 3px 5px rgba(var(--bg-dark-rgb),0.4);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.music-btn::before { /* Pulsing aura */
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: pulse-music-aura 2s infinite ease-out;
    opacity: 0;
}
.music-player-controls.playing .music-btn::before {
    opacity: 1;
}

@keyframes pulse-music-aura {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.7);
        opacity: 0.7;
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(var(--primary-color-rgb), 0);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0);
        opacity: 0;
    }
}


.music-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.music-btn:hover svg {
    transform: scale(1.15) rotate(10deg);
}
.music-btn:active svg {
    transform: scale(0.9);
}

.music-status-waves {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 0; /* Initially hidden */
    height: 20px;
    margin-left: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.4s ease-in-out 0.1s, margin-left 0.4s ease-in-out 0.1s, opacity 0.3s ease-in-out;
}
.music-player-controls.playing .music-status-waves {
    width: 30px; /* Width of the waves container */
    margin-left: var(--spacing-sm); /* 8px */
    opacity: 1;
}

.music-status-waves span {
    display: block;
    width: 3px;
    margin: 0 1px;
    background-color: var(--primary-color);
    border-radius: 2px;
    animation: music-wave 1.2s infinite ease-in-out alternate;
    height: 5px; /* Start height */
    transform-origin: bottom;
}
.music-status-waves span:nth-child(1) { animation-delay: -0.4s; }
.music-status-waves span:nth-child(2) { animation-delay: -0.2s; }
.music-status-waves span:nth-child(3) { animation-delay: 0s; }
.music-status-waves span:nth-child(4) { animation-delay: 0.2s; }
.music-status-waves span:nth-child(5) { animation-delay: 0.4s; }

@keyframes music-wave {
    0% { transform: scaleY(0.3); opacity: 0.5; background-color: var(--secondary-color); }
    50% { transform: scaleY(1); opacity: 1; background-color: var(--primary-color); }
    100% { transform: scaleY(0.5); opacity: 0.7; background-color: var(--accent-color); }
}

.music-tooltip {
    position: absolute;
    bottom: calc(100% + 10px); /* Position above the controls */
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background-color: rgba(var(--bg-dark-rgb), 0.9);
    color: var(--text-light);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}
.music-player-controls:hover .music-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}
.music-tooltip::after { /* Tooltip arrow */
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(var(--bg-dark-rgb), 0.9) transparent transparent transparent;
}

/* Hide one icon, show the other */
.music-player-controls .play-icon.icon-current,
.music-player-controls .pause-icon.icon-current {
    display: block;
}
.music-player-controls .play-icon:not(.icon-current),
.music-player-controls .pause-icon:not(.icon-current) {
    display: none;
}


/* Responsive adjustments for music controls if needed */
@media (max-width: 767px) {
    .music-player-controls {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }
    .music-btn {
        width: 45px;
        height: 45px;
    }
    .music-btn svg {
        width: 24px;
        height: 24px;
    }
    .music-player-controls.playing .music-status-waves {
        width: 25px;
    }
    .music-tooltip {
        font-size: 0.8rem;
    }
}
