/* CSS Variables - Professional Theming - Final Polish */
:root {
    /* --- LIGHT THEME --- */
    --theme-background: #F7F9FC;
    /* Slightly brighter, cleaner off-white */
    --theme-surface: rgba(255, 255, 255, 0.6);
    /* Adjusted for glassmorphism, slightly more opaque */
    --theme-navbar-bg: rgba(255, 255, 255, 0.98);
    /* Made even more opaque for light theme navbar */
    --theme-backdrop-blur: 15px;
    /* Slightly increased blur for glass */
    --theme-text-primary: #17263B;
    /* Deep slate blue, high contrast */
    --theme-text-secondary: #4A5568;
    /* Slate gray for secondary */
    --theme-text-tertiary: #718096;
    /* Lighter gray */
    --theme-text-on-accent: #FFFFFF;
    --theme-accent-main: #2563EB;
    /* Strong, confident Blue */
    --theme-accent-secondary: #3B82F6;
    /* Lighter, active blue */
    --theme-accent-glow: rgba(37, 99, 235, 0.35);
    /* Increased opacity for better visibility on light bg */
    --theme-accent-teal: #14B8A6;
    /* New Teal Accent */
    --theme-accent-teal-glow: rgba(20, 184, 166, 0.4);
    /* Teal Glow for shadows */
    --theme-accent-cyan: #06B6D4;
    /* New Cyan Accent */
    --theme-accent-cyan-glow: rgba(6, 182, 212, 0.4);
    /* Cyan Glow */
    --theme-border-color: rgba(0, 0, 0, 0.1);
    /* Darker translucent border for light theme glass */
    --theme-shadow-sm: 0 2px 4px rgba(23, 38, 59, 0.07);
    /* Slightly more pronounced default shadow */
    --theme-shadow-md: 0 6px 18px rgba(23, 38, 59, 0.1);
    /* More pronounced shadow for light theme glass */
    /* New variables for theme button */
    --theme-border-color-button: var(--theme-text-tertiary);
    /* #718096 */
    --theme-shadow-button-default: 0 3px 6px rgba(23, 38, 59, 0.12), 0 1px 3px rgba(23, 38, 59, 0.08);
    --theme-shadow-button-hover: 0 5px 10px rgba(37, 99, 235, 0.2), 0 2px 5px rgba(37, 99, 235, 0.15);
    /* Using accent for hover shadow */

    /* b.htm compatibility vars - Light */
    --primary-color-b: var(--theme-surface);
    --accent-color-b: var(--theme-accent-secondary);
    /* Use brighter blue for b.htm accent */
    --text-primary-b: var(--theme-text-primary);
    --text-secondary-b: var(--theme-text-secondary);
    --card-bg-b: rgba(255, 255, 255, 0.55);
    /* Adjusted for glassmorphism */
    --bg-dark-b: var(--theme-background);
    --transition-speed-b: 0.25s;
}

.dark-theme {
    /* --- DARK THEME --- */
    --theme-background: #121212;
    /* Even darker charcoal */
    --theme-surface: rgba(30, 30, 30, 0.55);
    /* Adjusted for new darker bg, more translucent */
    --theme-navbar-bg: rgba(20, 20, 20, 0.8);
    /* Adjusted navbar for new darker bg */
    --theme-backdrop-blur: 15px;
    /* Slightly increased blur for glass */
    --theme-text-primary: #E8EAED;
    /* Slightly brighter primary text for darker bg */
    --theme-text-secondary: #A8ADB1;
    /* Slightly brighter secondary text */
    --theme-text-tertiary: #80868B;
    --theme-text-on-accent: #FFFFFF;
    --theme-accent-main: #38BDF8;
    --theme-accent-secondary: #7DD3FC;
    --theme-accent-glow: rgba(56, 189, 248, 0.2);
    /* Slightly stronger glow */
    --theme-accent-teal: #2DD4BF;
    --theme-accent-teal-glow: rgba(45, 212, 191, 0.45);
    --theme-accent-cyan: #0891B2;
    --theme-accent-cyan-glow: rgba(8, 145, 178, 0.5);
    --theme-border-color: rgba(255, 255, 255, 0.12);
    /* Maintained subtle light border */
    --theme-shadow-sm: 0 3px 7px rgba(0, 0, 0, 0.35);
    --theme-shadow-md: 0 6px 22px rgba(0, 0, 0, 0.4);
    /* New variables for theme button - Dark Theme */
    --theme-border-color-button: var(--theme-text-secondary);
    --theme-shadow-button-default: 0 3px 6px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.35);
    --theme-shadow-button-hover: 0 5px 12px rgba(56, 189, 248, 0.3), 0 2px 6px rgba(56, 189, 248, 0.25);

    /* b.htm compatibility for dark */
    --primary-color-b: var(--theme-text-primary);
    --accent-color-b: var(--theme-accent-secondary);
    --text-primary-b: var(--theme-text-primary);
    --text-secondary-b: var(--theme-text-secondary);
    --card-bg-b: rgba(30, 30, 30, 0.45);
    --bg-dark-b: var(--theme-background);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    /* Ensure html tag also takes full height */
    overflow-x: hidden;
    /* Keep this here too */
    /* Enhanced touch scrolling for mobile */
    touch-action: auto;
    -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
    overscroll-behavior-y: auto; /* Allow pull-to-refresh */
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--theme-background);
    color: var(--theme-text-primary);
    min-height: 100%;
    /* Changed from 100vh to 100% to work with html height */
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    position: relative;
    transition: background 0.3s ease, color 0.3s ease;
    /* Enhanced touch scrolling for mobile */
    touch-action: auto;
    -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
    overscroll-behavior-y: auto; /* Allow pull-to-refresh */
    /* Slanted Amber Triangle Cursor */
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpolygon points='16,4 26,26 6,26' fill='%23B45309' transform='rotate(-45 16 16)'/%3E%3C/svg%3E") 8 8, auto;
}

.dark-theme body {
    /* Remove specific dark theme cursor, use the one from body */
    /* cursor: url(...) ... */
}

/* Enhanced touch-action for mobile scrolling - CRITICAL FIX */
*, *::before, *::after {
    touch-action: auto;
}

/* Allow manipulation for truly interactive elements only */
button, a, .social-link, .theme-btn, .email-flyout-trigger {
    touch-action: manipulation;
}

/* FIXED: Fixed elements should not interfere with scrolling */
#canvas-background, .glow {
    touch-action: auto;
    pointer-events: none; /* Allow touch events to pass through */
}

.flyout-overlay {
    touch-action: auto;
    pointer-events: none;
}

.flyout-overlay.active {
    pointer-events: auto;
    touch-action: manipulation;
}

a:hover,
button:hover,
.social-link:hover,
.nav-item-link:hover,
.theme-btn:hover {
    /* Updated from .theme-toggle-btn:hover */
    cursor: pointer;
    /* Ensure interactive elements clearly show pointer */
}

/* Canvas background */
#canvas-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Content section with glassmorphism effect */
.content-section {
    background: var(--theme-surface);
    backdrop-filter: blur(var(--theme-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--theme-backdrop-blur));
    border-radius: 1rem;
    border: 1px solid var(--theme-border-color);
    padding: 2rem;
    margin-top: 1rem;
    box-shadow: var(--theme-shadow-md);
    width: 100%;
    transform: translateY(50px);
    opacity: 0;
}

.container {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Header should be a simple sticky wrapper */
header {
    padding-top: 1.5rem;
    /* Increased top padding to move banner down */
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

/* The .container within header creates the banner with margins */
header>.container {
    background-color: var(--theme-navbar-bg);
    backdrop-filter: blur(var(--theme-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--theme-backdrop-blur));
    border: 1px solid var(--theme-border-color);
    box-shadow: var(--theme-shadow-md);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    /* Standardized padding: 1rem vertical, 1.5rem horizontal */
    max-width: 1200px;
    /* Ensuring it has a max-width */
    margin-left: auto;
    /* Centering it */
    margin-right: auto;
    /* Centering it */
}

/* Ensure main content area expands correctly */
main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.navbar-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

.main-navigation-menu {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    padding: 0.75rem 0;
}

.dark-theme .main-navigation-menu {
    /* border-top-color: var(--theme-border-color); - Temporarily hidden */
}

.navbar-brand {
    margin-right: 0;
    transition: transform var(--transition-speed-b) ease;
    margin-bottom: 0.5rem;
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.navbar-brand h1 {
    font-size: 2rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.15rem;
    padding-left: 0.5rem;
    line-height: 1.1;
    background: linear-gradient(45deg, var(--theme-text-primary), var(--theme-accent-main));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark-theme .navbar-brand h1 {
    background: linear-gradient(45deg, var(--theme-text-primary), var(--theme-accent-main));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand .tagline {
    font-size: 0.8rem;
    color: var(--theme-text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding-left: 0.5rem;
    opacity: 0.75;
    display: flex;
    /* For spacing tagline words */
    gap: 0.25em;
    /* Space between words and separators */
    align-items: center;
}

.navbar-brand .tagline .tagline-word {
    font-weight: 500;
    /* More prominent */
    transition: transform 0.2s ease, color 0.2s ease;
    /* For hover micro-interaction */
}

.navbar-brand .tagline .tagline-word:hover {
    color: var(--theme-accent-main);
    transform: translateY(-1px) scale(1.03);
}

.navbar-brand .tagline .tagline-separator {
    color: var(--theme-accent-main);
    font-weight: 700;
    opacity: 0.85;
    /* margin: 0 0.3em; Replaced by gap on parent */
}

.main-navigation-links {
    padding-top: 0;
}

.nav-item-link {
    color: var(--theme-text-secondary);
    text-decoration: none !important;
    transition: color var(--transition-speed-b) ease, transform var(--transition-speed-b) ease;
    position: relative;
}

.nav-item-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--theme-accent-main);
    transition: width var(--transition-speed-b) ease;
}

.nav-item-link:hover {
    color: var(--theme-accent-main);
    transform: translateY(-2px);
    text-decoration: none !important;
}

.nav-item-link:hover::after {
    width: 100%;
}

.contact-info {
    padding-left: 0;
}

.header-right-V2 {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0;
}

.contact-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    color: var(--theme-text-secondary);
    /* Default color for the item */
    font-size: 0.9rem;
    /* Set base font size here */
    opacity: 0;
    transform: translateX(20px);
    transition: color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

.contact-item:hover {
    /* color: var(--theme-accent-main); Removed, handle per element */
}

.contact-item:hover i {
    transform: scale(1.15);
    color: var(--theme-accent-secondary);
}

.contact-item:hover span {
    color: var(--theme-accent-main);
}

.contact-item span {
    font-family: inherit;
    font-size: 1.05rem;
    /* Increased size for phone/email */
    font-weight: 500;
    color: var(--theme-text-primary);
    /* Ensure primary color */
    transition: color 0.2s ease, transform 0.2s ease;
}

.contact-item i {
    color: var(--theme-accent-main);
    font-size: 1.3em;
    /* Kept relative size, will increase due to parent */
    opacity: 1;
    margin-right: 0.3em;
    /* Slightly more space */
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Removed .contact-item small styles as the element is gone */

/* .contact-item span:hover is handled by .contact-item:hover span now */

/* Styles for the theme button that replaced the old toggle */
/* .theme-toggle-btn (old class for pill toggle) - can be removed if no longer used elsewhere */
/* .theme-toggle-thumb (old class for pill toggle thumb) - can be removed if no longer used elsewhere */
/* .theme-toggle-btn .theme-icon-sun, .theme-toggle-btn .theme-icon-moon (old classes for icons in pill) - can be removed if no longer used elsewhere */

.hero-greeting {
    font-size: 2.5rem;
    color: var(--theme-text-primary);
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
}

/* Hero text animation specific styles */
.hero-char {
    display: inline-block;
    position: relative;
    will-change: transform, opacity;
}

.greeting-highlight .hero-char {
    color: var(--theme-accent-main);
}

.greeting-highlight {
    color: var(--theme-accent-main);
}

.dark-theme .hero-greeting {
    /* color: var(--theme-text-primary); Already inherited */
}

.dark-theme .greeting-highlight {
    color: var(--theme-accent-main);
    /* Ensure accent color is used in dark theme too */
}

.wave-emoji {
    display: inline-block;
    animation: waveAnimation 2s infinite;
    transform-origin: 70% 70%;
}

@keyframes waveAnimation {
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(14deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.hero-main-summary {
    font-size: 1rem;
    /* Increased from 0.85rem */
    font-weight: 400;
    /* Explicitly set for body text */
    color: var(--theme-text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
}

.hamburger-menu-toggle {
    display: none !important;
}

main>.container {
    padding-left: 0;
    padding-right: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Individual Social Link Brand Colors (re-instating concept) */
.social-link-linkedin {
    --social-brand-color: #0077B5;
}

.social-link-github {
    --social-brand-color: #181717;
}

.dark-theme .social-link-github {
    --social-brand-color: #CDCDCD;
}

.social-link-twitter {
    --social-brand-color: #1DA1F2;
}

.dark-theme .social-link-twitter {
    --social-brand-color: #1DA1F2;
}

.social-link-instagram {
    --social-brand-color: #E1306C;
}

.social-link-facebook {
    --social-brand-color: #1877F2;
}

.social-link-soundcloud {
    --social-brand-color: #FF5500;
}

.social-link-lichess {
    --social-brand-color: #639B40;
}

.social-link-bluesky {
    --social-brand-color: #00A8E8;
}

#theme-toggle-container {
    position: fixed;
    top: 20px;
    right: 35px;
    /* Moved further from the edge to give tooltip more room */
    z-index: 1001;
}

.theme-btn {
    background-color: var(--theme-surface);
    border: 2px solid var(--theme-border-color-button);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--theme-shadow-button-default);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.theme-btn:hover {
    background-color: var(--theme-accent-secondary);
    border-color: var(--theme-accent-main);
    box-shadow: var(--theme-shadow-button-hover);
}

.theme-btn:hover .mdi {
    color: var(--theme-text-on-accent);
}

.dark-theme .theme-btn {
    background-color: var(--theme-surface);
    color: var(--theme-text-primary);
    border-color: var(--theme-border-color-button);
}

.dark-theme .theme-btn:hover {
    background-color: var(--theme-accent-secondary);
    color: var(--theme-text-on-accent);
    border-color: var(--theme-accent-main);
}

.dark-theme .theme-btn:hover .mdi {
    color: var(--theme-text-on-accent);
}

.theme-btn .mdi {
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1;
    color: var(--theme-text-primary);
    transition: color 0.2s ease;
}

.dark-theme .theme-btn .mdi {
    color: var(--theme-text-primary);
}

@media (max-width: 767px) {
    #theme-toggle-container {
        top: 20px;
        /* Moved down from 12px */
        right: 15px;
        /* Moved left from 20px */
    }

    /* Mobile tooltip adjustments */
    [data-tooltip]::before {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        max-width: 150px;
        /* Smaller tooltips on mobile */
    }

    .theme-btn {
        width: 40px;
        /* Reduced size */
        height: 40px;
        /* Reduced size */
    }

    .theme-btn .mdi {
        font-size: 1.3rem;
        /* Further reduced icon size */
    }

    .contact-item {
        font-size: 0.9rem;
        /* Adjusted base for mobile */
    }

    .contact-item span {
        font-family: inherit;
        font-size: inherit;
        /* Inherit mobile base size */
        font-weight: 500;
        color: var(--theme-text-primary);
    }

    .contact-item i {
        font-size: 1.3em;
        /* Relative to mobile base size */
    }

    .hero-greeting {
        font-size: 2.1rem;
        /* Adjusted for mobile */
    }

    .hero-main-summary {
        font-size: 0.95rem;
        /* Adjusted for mobile */
    }

    .stay-connected {
        font-size: 1rem;
    }

    html,
    body {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    #theme-toggle-container {
        top: 25px;
        /* Even further down for smallest screens */
        right: 12px;
        /* Even further to the left */
    }

    .navbar-brand h1 {
        font-size: 1.75rem;
    }

    .navbar-brand .tagline {
        font-size: 0.75rem;
    }

    .navbar-brand .tagline .tagline-word {
        font-weight: 500;
        /* Keep consistent or adjust for smaller size */
    }

    .page-description {
        font-size: 1rem;
        gap: 0.75rem;
    }

    .page-description span {
        padding-right: 0.75rem;
    }

    .social-link {
        width: 2.5rem;
        height: 2.5rem;
    }

    .social-link i {
        font-size: 1.25rem;
    }
}

.stay-connected {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--theme-text-primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding-left: 0.5rem;
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding-bottom: 0.3em;
    text-decoration: none;
}

.stay-connected::before {
    content: '';
    position: absolute;
    bottom: -2px;
    /* Position slightly below the text */
    left: 0;
    width: 0;
    /* Initial width for GSAP animation */
    height: 2.5px;
    background-color: var(--theme-accent-main);
    /* Use main accent for the beam */
    border-radius: 1px;
    opacity: 1;
    /* Keep it opaque */
    transition: width 0.3s ease-out;
    /* Fallback CSS transition if JS/GSAP fails */
}

/* No need for .stay-connected:hover::before if GSAP handles it fully */

.footer-social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
    align-items: center;
}

/* Container for the email icon and its flyout menu */
.email-flyout-container {
    position: relative;
    display: inline-flex;
}

.email-flyout-trigger {
    /* Inherits .social-link styles */
}

/* Flyout Overlay Styling */
.flyout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 30, 30, 0.92);
    /* Dark gray, highly opaque for light theme */
    z-index: 1004;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dark-theme .flyout-overlay {
    background-color: rgba(0, 0, 0, 0.95);
    /* Near black, highly opaque for dark theme */
}

.flyout-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Flyout Menu Styling */
.email-flyout-menu {
    position: fixed;
    /* background-color: var(--theme-surface); Overridden for more opacity */
    background-color: rgba(255, 255, 255, 0.85);
    /* Whiter and more opaque for light theme */
    backdrop-filter: blur(var(--theme-backdrop-blur));
    /* Keep the blur for what's behind */
    -webkit-backdrop-filter: blur(var(--theme-backdrop-blur));
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Light theme border, adjust if needed */
    border-radius: 0.75rem;
    box-shadow: var(--theme-shadow-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1005;
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom center;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    min-width: 230px;
    max-height: 80vh;
    overflow-y: auto;
}

.dark-theme .email-flyout-menu {
    background-color: rgba(35, 35, 35, 0.8);
    /* Darker, more opaque surface for dark theme flyout */
    border-color: rgba(255, 255, 255, 0.15);
    /* Dark theme border */
}

.email-flyout-menu.visible {
    opacity: 1;
    visibility: visible;
}

.flyout-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1rem;
    color: var(--theme-text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 1.05rem;
    font-weight: 500;
}

.flyout-item:hover {
    background-color: var(--theme-accent-main);
    color: var(--theme-text-on-accent);
    text-decoration: none;
}

.flyout-item .mdi {
    font-size: 1.5em;
    color: var(--theme-accent-main);
}

.flyout-item:hover .mdi {
    color: var(--theme-text-on-accent);
}

/* Styles for .social-link and other elements continue below... */
/* Ensure no FAB specific styles like .speed-dial-actions, .speed-dial-action, .speed-dial-label remain active */

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background-color: var(--theme-surface);
    color: var(--theme-text-primary);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all var(--transition-speed-b) ease;
    border: 1.5px solid var(--theme-text-tertiary);
    /* opacity: 0; GSAP handles initial opacity for non-FAB social links */
    /* transform: scale(0.8); GSAP handles initial transform for non-FAB social links */
    box-shadow: var(--theme-shadow-sm);
}

.social-link i {
    font-size: 2rem;
    line-height: 1;
    color: var(--theme-text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
}

.dark-theme .social-link {
    border-color: var(--theme-border-color);
    /* Dark theme uses its specific subtle border */
}

.social-link:hover {
    text-decoration: none;
}

.glow {
    position: fixed;
    width: 120px;
    height: 120px;
    background: var(--theme-accent-glow);
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0;
    /* Initially hidden, JS will make it visible */
    visibility: hidden;
    /* Initially hidden */
    pointer-events: none;
    z-index: 9998;
    /* transform: translate(-50%, -50%); /* REMOVE - GSAP will handle all transforms via x, y, xPercent, yPercent */
    /* animation: pulseGlow 2.5s infinite ease-in-out; /* REMOVE - GSAP will handle pulse */
}

/* @keyframes pulseGlow { ... } /* REMOVE - GSAP will handle pulse */

.reveal-line {
    position: absolute;
    height: 2px;
    width: 0;
    background-color: var(--theme-accent-main);
    bottom: -2px;
    left: 0;
    transition: width 0.3s ease;
}

.navbar-text:hover .reveal-line {
    width: 100%;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@media (max-width: 991px) {
    .navbar-top-row {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 1rem;
    }

    .navbar-brand {
        margin-right: auto;
        text-align: left;
    }

    .main-navigation-menu {
        order: 3;
        width: 100%;
    }

    .header-right-V2 {}
}

@media (max-width: 767px) {
    header {
        padding-top: 1rem;
    }

    .navbar-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .navbar-brand {
        width: 100%;
        text-align: left;
        margin-bottom: 0.75rem;
    }

    .header-right-V2 {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .contact-details {
        width: auto;
        align-items: flex-start;
    }

    .contact-item {
        font-size: 0.9rem;
        /* Adjusted base for mobile */
    }

    .contact-item span {
        font-family: inherit;
        font-size: inherit;
        /* Inherit mobile base size */
        font-weight: 500;
        color: var(--theme-text-primary);
    }

    .contact-item i {
        font-size: 1.3em;
        /* Relative to mobile base size */
    }

    .hero-greeting {
        font-size: 2.1rem;
        /* Adjusted for mobile */
    }

    .hero-main-summary {
        font-size: 0.95rem;
        /* Adjusted for mobile */
    }

    .stay-connected {
        font-size: 1rem;
    }

    html,
    body {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .navbar-brand h1 {
        font-size: 1.75rem;
    }

    .navbar-brand .tagline {
        font-size: 0.75rem;
    }

    .navbar-brand .tagline .tagline-word {
        font-weight: 500;
        /* Keep consistent or adjust for smaller size */
    }

    .page-description {
        font-size: 1rem;
        gap: 0.75rem;
    }

    .page-description span {
        padding-right: 0.75rem;
    }

    .social-link {
        width: 2.5rem;
        height: 2.5rem;
    }

    .social-link i {
        font-size: 1.25rem;
    }
}

.page-description {
    max-width: 100%;
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-left: 0.5rem;
}

.page-description span {
    position: relative;
    color: var(--theme-text-secondary);
    transition: all var(--transition-speed-b) ease;
    padding-right: 1.5rem;
    transform: translateY(15px);
    opacity: 0;
}

.page-description span:hover {
    color: var(--theme-accent-main);
}

.page-description span::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 1em;
    background: linear-gradient(to bottom, transparent 0%, var(--theme-accent-main) 30%, var(--theme-accent-main) 70%, transparent 100%);
    opacity: 0.5;
}

.page-description span:last-child::after {
    display: none;
}

/* Custom Tooltip Styles */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease, visibility 0.1s ease;
    /* Fast transition */
    pointer-events: none;
    z-index: 1010;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    background-color: var(--theme-text-primary);
    color: var(--theme-background);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--theme-shadow-md);
    max-width: 200px;
    /* Add max-width to prevent overflow on mobile */
    word-wrap: break-word;
    /* Allow text to wrap if needed */
}

/* Special handling for lichess tooltip - make it wrap text */
.social-link-lichess[data-tooltip]::before {
    white-space: normal;
    width: 140px;
    text-align: center;
}

@media (max-width: 767px) {

    /* Make lichess tooltip wider on mobile */
    .social-link-lichess[data-tooltip]::before {
        width: 120px;
        left: auto;
        right: 0;
        transform: none;
    }

    .social-link-lichess[data-tooltip]::after {
        left: auto;
        right: 15px;
        transform: none;
    }
}

[data-tooltip]::after {
    content: '';
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--theme-text-primary) transparent transparent transparent;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

.dark-theme [data-tooltip]::before {
    background-color: var(--theme-text-primary);
    color: var(--theme-background);
}

.dark-theme [data-tooltip]::after {
    border-color: var(--theme-text-primary) transparent transparent transparent;
}

/* Bottom position tooltips */
[data-tooltip-position="bottom"]::before {
    bottom: auto;
    top: 125%;
}

[data-tooltip-position="bottom"]::after {
    bottom: auto;
    top: 115%;
    border-color: transparent transparent var(--theme-text-primary) transparent;
}

/* Special styling for theme button tooltip to prevent viewport overflow */
#theme-toggle-button[data-tooltip-position="bottom"]::before {
    right: 0;
    left: auto;
    transform: none;
}

#theme-toggle-button[data-tooltip-position="bottom"]::after {
    right: 15px;
    left: auto;
    transform: none;
}

.stay-connected {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--theme-text-primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding-left: 0.5rem;
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding-bottom: 0.3em;
    text-decoration: none;
}

.stay-connected::before {
    content: '';
    position: absolute;
    bottom: -2px;
    /* Position slightly below the text */
    left: 0;
    width: 0;
    /* Initial width for GSAP animation */
    height: 2.5px;
    background-color: var(--theme-accent-main);
    /* Use main accent for the beam */
    border-radius: 1px;
    opacity: 1;
    /* Keep it opaque */
    transition: width 0.3s ease-out;
    /* Fallback CSS transition if JS/GSAP fails */
}

/* No need for .stay-connected:hover::before if GSAP handles it fully */

.footer-social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
    align-items: center;
}

/* Container for the email icon and its flyout menu */
.email-flyout-container {
    position: relative;
    display: inline-flex;
}

.email-flyout-trigger {
    /* Inherits .social-link styles */
}

/* Flyout Overlay Styling */
.flyout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 30, 30, 0.92);
    /* Dark gray, highly opaque for light theme */
    z-index: 1004;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dark-theme .flyout-overlay {
    background-color: rgba(0, 0, 0, 0.95);
    /* Near black, highly opaque for dark theme */
}

.flyout-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Flyout Menu Styling */
.email-flyout-menu {
    position: fixed;
    /* background-color: var(--theme-surface); Overridden for more opacity */
    background-color: rgba(255, 255, 255, 0.85);
    /* Whiter and more opaque for light theme */
    backdrop-filter: blur(var(--theme-backdrop-blur));
    /* Keep the blur for what's behind */
    -webkit-backdrop-filter: blur(var(--theme-backdrop-blur));
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Light theme border, adjust if needed */
    border-radius: 0.75rem;
    box-shadow: var(--theme-shadow-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1005;
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom center;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    min-width: 230px;
    max-height: 80vh;
    overflow-y: auto;
}

.dark-theme .email-flyout-menu {
    background-color: rgba(35, 35, 35, 0.8);
    /* Darker, more opaque surface for dark theme flyout */
    border-color: rgba(255, 255, 255, 0.15);
    /* Dark theme border */
}

.email-flyout-menu.visible {
    opacity: 1;
    visibility: visible;
}

.flyout-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1rem;
    color: var(--theme-text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 1.05rem;
    font-weight: 500;
}

.flyout-item:hover {
    background-color: var(--theme-accent-main);
    color: var(--theme-text-on-accent);
    text-decoration: none;
}

.flyout-item .mdi {
    font-size: 1.5em;
    color: var(--theme-accent-main);
}

.flyout-item:hover .mdi {
    color: var(--theme-text-on-accent);
}

/* Styles for .social-link and other elements continue below... */
/* Ensure no FAB specific styles like .speed-dial-actions, .speed-dial-action, .speed-dial-label remain active */

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background-color: var(--theme-surface);
    color: var(--theme-text-primary);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all var(--transition-speed-b) ease;
    border: 1.5px solid var(--theme-text-tertiary);
    /* opacity: 0; GSAP handles initial opacity for non-FAB social links */
    /* transform: scale(0.8); GSAP handles initial transform for non-FAB social links */
    box-shadow: var(--theme-shadow-sm);
}

.social-link i {
    font-size: 2rem;
    line-height: 1;
    color: var(--theme-text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
}

.dark-theme .social-link {
    border-color: var(--theme-border-color);
    /* Dark theme uses its specific subtle border */
}

.social-link:hover {
    text-decoration: none;
}

.glow {
    position: fixed;
    width: 120px;
    height: 120px;
    background: var(--theme-accent-glow);
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0;
    /* Initially hidden, JS will make it visible */
    visibility: hidden;
    /* Initially hidden */
    pointer-events: none;
    z-index: 9998;
    /* transform: translate(-50%, -50%); /* REMOVE - GSAP will handle all transforms via x, y, xPercent, yPercent */
    /* animation: pulseGlow 2.5s infinite ease-in-out; /* REMOVE - GSAP will handle pulse */
}

/* @keyframes pulseGlow { ... } /* REMOVE - GSAP will handle pulse */

.reveal-line {
    position: absolute;
    height: 2px;
    width: 0;
    background-color: var(--theme-accent-main);
    bottom: -2px;
    left: 0;
    transition: width 0.3s ease;
}

.navbar-text:hover .reveal-line {
    width: 100%;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@media (max-width: 991px) {
    .navbar-top-row {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 1rem;
    }

    .navbar-brand {
        margin-right: auto;
        text-align: left;
    }

    .main-navigation-menu {
        order: 3;
        width: 100%;
    }

    .header-right-V2 {}
}

@media (max-width: 767px) {
    header {
        padding-top: 1rem;
    }

    .navbar-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .navbar-brand {
        width: 100%;
        text-align: left;
        margin-bottom: 0.75rem;
    }

    .header-right-V2 {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .contact-details {
        width: auto;
        align-items: flex-start;
    }

    .contact-item {
        font-size: 0.9rem;
        /* Adjusted base for mobile */
    }

    .contact-item span {
        font-family: inherit;
        font-size: inherit;
        /* Inherit mobile base size */
        font-weight: 500;
        color: var(--theme-text-primary);
    }

    .contact-item i {
        font-size: 1.3em;
        /* Relative to mobile base size */
    }

    .hero-greeting {
        font-size: 2.1rem;
        /* Adjusted for mobile */
    }

    .hero-main-summary {
        font-size: 0.95rem;
        /* Adjusted for mobile */
    }

    .stay-connected {
        font-size: 1rem;
    }

    html,
    body {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .navbar-brand h1 {
        font-size: 1.75rem;
    }

    .navbar-brand .tagline {
        font-size: 0.75rem;
    }

    .navbar-brand .tagline .tagline-word {
        font-weight: 500;
        /* Keep consistent or adjust for smaller size */
    }

    .page-description {
        font-size: 1rem;
        gap: 0.75rem;
    }

    .page-description span {
        padding-right: 0.75rem;
    }

    .social-link {
        width: 2.5rem;
        height: 2.5rem;
    }

    .social-link i {
        font-size: 1.25rem;
    }
}

/* Additional Mobile Scroll Optimizations - CRITICAL FIX */
@supports (-webkit-overflow-scrolling: touch) {
    html, body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile-specific scroll improvements */
@media (max-width: 768px) {
    html, body {
        overflow-y: auto !important; /* Force vertical scrolling */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: auto;
    }
    
    /* Prevent scroll interference from fixed elements */
    #theme-toggle-container {
        touch-action: manipulation !important;
    }
    
    /* FIXED: Ensure canvas doesn't interfere with touch while allowing scroll */
    #canvas-background {
        touch-action: auto !important;
        pointer-events: none !important;
    }
    
    /* Ensure main content allows scrolling */
    main, .container, .content-section {
        touch-action: auto !important;
    }
}
/* Footer Styles */
.site-footer {
    background: var(--theme-surface);
    backdrop-filter: blur(var(--theme-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--theme-backdrop-blur));
    border-top: 1px solid var(--theme-border-color);
    border-radius: 1rem 1rem 0 0;
    margin-top: 2rem;
    padding: 1.5rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s ease;
    box-shadow: var(--theme-shadow-md);
    margin-bottom: 0;
}

.site-footer.visible {
    opacity: 1;
    transform: translateY(0);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copyright p {
    margin: 0;
    color: var(--theme-text-secondary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.footer-link {
    color: var(--theme-accent-main);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.footer-link:hover {
    color: var(--theme-accent-secondary);
    text-decoration: underline;
}

.footer-version {
    opacity: 0.7;
    font-family: 'Inter', monospace;
    font-size: 0.8rem;
    color: var(--theme-text-tertiary);
    font-weight: 500;
    letter-spacing: 0.05em;
}

.footer-version p {
    margin: 0;
}

/* Mobile Footer Styles */
@media (max-width: 767px) {
    .site-footer {
        margin-top: 1.5rem;
        padding: 1.25rem 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .footer-copyright p {
        font-size: 0.85rem;
    }
    
    .footer-version {
        font-size: 0.75rem;
        opacity: 0.6;
    }
}

@media (max-width: 480px) {
    .site-footer {
        padding: 1rem 0;
    }
    
    .footer-content {
        gap: 0.5rem;
    }
    
    .footer-copyright p {
        font-size: 0.8rem;
    }
    
    .footer-version {
        font-size: 0.7rem;
    }
}
