/* ========================================== */ 
/* DESIGN SYSTEM TOKENS                       */
/* ========================================== */
:root {
    --bg-dark: #030305;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --color-primary: #00F2FE;
    --color-secondary: #9D4EDD;
    --color-accent: #4ADE80;
    --glass-bg: rgba(10, 12, 18, 0.4);
    --glass-border: rgba(249, 250, 251, 0.05);
    --ease-out-cubic: cubic-bezier(0.16, 1, 0.3, 1);
    --z-canvas: 0;
    --z-scroll: 10;
    --z-back-to-top: 60;
    --z-mobile-backdrop: 70;
    --z-mobile-menu: 80;
    --z-lightbox: 200;
    --z-noise: 999;
    --z-cursor: 9999;
    --z-preloader: 10000;
    --z-skip-link: 10001;
}

/* Base Reset & Defaults */
*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body { 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    overflow-x: hidden; 
    cursor: default; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100dvh;
    overflow-wrap: break-word;
}

@media (pointer: fine) {
    body {
        cursor: none;
    }
}

/* Cinematic Noise Overlay */
.noise { 
    position: fixed; 
    inset: 0; 
    z-index: var(--z-noise); 
    pointer-events: none; 
    opacity: 0.035; 
    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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"); 
    will-change: transform;
}

/* Fixed 3D Canvas */
#webgl-canvas { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    z-index: var(--z-canvas); 
    pointer-events: none; 
    contain: strict;
}

/* Main Scrolling Container */
#scroll-container { 
    position: relative; 
    z-index: var(--z-scroll); 
    perspective: 1200px; 
}

/* Typography Utilities */
.text-gradient { 
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text;
}

.text-gradient-secondary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text;
}

/* Section Formatting */
section { 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    position: relative; 
    padding: 120px 5%; 
    scroll-margin-top: 96px;
}

/* Accessibility Focus States */
a:focus-visible,
button:focus-visible,
[tabindex="0"]:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 6px;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: var(--z-skip-link);
    background: var(--color-primary);
    color: var(--bg-dark);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    transition: top 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.skip-link:focus { top: 1rem; }

/* Back-to-top control */
#back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 18, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 242, 254, 0.4);
    color: var(--color-primary);
    z-index: var(--z-back-to-top);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
#back-to-top:hover { border-color: var(--color-primary); background: rgba(0, 242, 254, 0.15); }

.nav-link.is-active { color: var(--color-primary); }
.nav-link.is-active::after { width: 100%; }

/* ========================================== */
/* IN-CONTEXT CSS 3D GLASSMORPHISM            */
/* ========================================== */
.glass-3d {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(3, 3, 5, 0.5);
    transform-style: preserve-3d; 
    transition: border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
    position: relative;
}
@supports not (backdrop-filter: blur(24px)) {
    .glass-3d { background: rgba(15, 18, 25, 0.92); }
}
.glass-3d:hover { 
    border-color: rgba(0, 242, 254, 0.4); 
    background: rgba(15, 18, 25, 0.7); 
    box-shadow: 0 40px 80px rgba(0, 242, 254, 0.15); 
}

.pop-out { transform: translateZ(40px); transition: transform 0.3s ease; transform-style: preserve-3d; }
.pop-out-extreme { transform: translateZ(80px); transition: transform 0.3s ease; transform-style: preserve-3d; }
.pop-out-subtle { transform: translateZ(20px); transition: transform 0.3s ease; }

/* Custom Cursor */
/* PERF FIX: positioned at top:0/left:0 and moved purely via `transform` (GPU-composited,
   no layout impact) instead of writing `left`/`top` on every mousemove. */
.cursor-dot { 
    position: fixed; top: 0; left: 0; width: 8px; height: 8px; background: var(--color-primary); 
    border-radius: 50%; transform: translate(-50%, -50%); z-index: var(--z-cursor); 
    pointer-events: none; box-shadow: 0 0 10px var(--color-primary); will-change: transform;
}
.cursor-ring { 
    position: fixed; top: 0; left: 0; width: 45px; height: 45px; border: 1px solid rgba(0, 242, 254, 0.6); 
    border-radius: 50%; transform: translate(-50%, -50%); z-index: calc(var(--z-cursor) - 1); 
    pointer-events: none; transition: width 0.3s var(--ease-out-cubic), height 0.3s var(--ease-out-cubic), background-color 0.3s ease, border-color 0.3s ease; 
    will-change: transform, width, height;
}

/* Loader */
#loader { 
    position: fixed; inset: 0; background: var(--bg-dark); 
    z-index: var(--z-preloader); display: flex; flex-direction: column; 
    align-items: center; justify-content: center; 
}
/* Prevent CLS on loader text */
#loading-percentage { min-height: 16px; display: block; }

.loader-glitch { position: relative; }
.loader-glitch::before, .loader-glitch::after {
    content: "PARASFOLIO"; position: absolute; top: 0; left: 0; opacity: 0.8;
}
.loader-glitch::before { color: var(--color-primary); z-index: -1; animation: glitch-anim-1 2s infinite linear alternate-reverse; }
.loader-glitch::after { color: var(--color-secondary); z-index: -2; animation: glitch-anim-2 3s infinite linear alternate-reverse; }

@keyframes glitch-anim-1 {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}
@keyframes glitch-anim-2 {
    0% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(2px, 2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(-2px, 2px); }
    100% { transform: translate(0); }
}

::-webkit-scrollbar { width: 8px; } 
::-webkit-scrollbar-track { background: var(--bg-dark); } 
::-webkit-scrollbar-thumb { background: #1E2235; border-radius: 10px; } 
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

.terminal-header {
    background: rgba(249, 250, 251, 0.03);
    border-bottom: 1px solid rgba(249, 250, 251, 0.05);
    padding: 10px 20px; display: flex; align-items: center;
}
.terminal-btn { width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; }

.nav-link { position: relative; }
.nav-link::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: -4px; left: 0; background-color: var(--color-primary);
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

/* Prevent CLS on Hero Title */
.hero-title { font-size: clamp(2.75rem, 9vw, 7rem) !important; min-height: 1.1em; }

.clip-hex { clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ========================================== */
/* GALLERY: PINNED HORIZONTAL SCROLL SYSTEM   */
/* ========================================== */
#gallery-pin { overflow: hidden; position: relative; }
#gallery-pin[role="region"] { outline: none; }
#gallery-track { display: flex; align-items: center; gap: 2rem; will-change: transform; padding: 4rem 4vw; }
/* PERF/CORRECTNESS FIX: .gallery-card is queried directly by JS
   (gsap.utils.toArray('.gallery-card') in initGalleryScroll, and
   document.querySelectorAll('.gallery-card') in initGalleryLightbox) to build the
   pinned horizontal-scroll photo gallery + its lightbox. The ML Portfolio project
   cards want the same glass-card visual language but must NOT be swept into that
   selection (they have no .gallery-card-media, which would produce dead slides in
   the scroller/lightbox). So the shared base look now lives on .showcase-card
   (used by both project cards and photo cards); .gallery-card stays reserved for
   elements that should actually participate in the scroll/lightbox system. */
.showcase-card { position: relative; border-radius: 28px; overflow: hidden; transition: box-shadow 0.4s ease; }
.gallery-card { position: relative; border-radius: 28px; overflow: hidden; transition: box-shadow 0.4s ease; }

/* Pinned horizontal-scroll variant */
#gallery-track .gallery-card {
    flex: 0 0 auto; width: min(90vw, 460px); transform: translate3d(0,0,0) scale(0.85); opacity: 0.5; will-change: transform, opacity;
}
#gallery-track .gallery-card:nth-child(even) { margin-top: 4rem; }
#gallery-track .gallery-card:nth-child(odd) { margin-bottom: 4rem; }

.gallery-card-inner {
    position: relative; border-radius: 28px; background: rgba(10, 12, 18, 0.55);
    backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(249, 250, 251, 0.08); transform-style: preserve-3d; overflow: hidden; transition: box-shadow 0.4s ease;
}
.gallery-card-glow {
    position: absolute; inset: -1px; border-radius: 28px; padding: 1px;
    background: linear-gradient(135deg, rgba(0,242,254,0.6), rgba(157,78,221,0.5), transparent 60%);
    -webkit-mask: linear-gradient(#030305 0 0) content-box, linear-gradient(#030305 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.4s ease; pointer-events: none;
}
.showcase-card:hover .gallery-card-glow { opacity: 1; }
.showcase-card:hover .gallery-card-inner { box-shadow: 0 40px 90px rgba(0,242,254,0.18); }

.gallery-card-media { position: relative; height: 320px; overflow: hidden; cursor: pointer; }
.gallery-card-media img,
.gallery-card-media video {
    width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); opacity: 0; transition: transform 0.7s var(--ease-out-cubic), opacity 0.5s ease;
}
.gallery-card-media img.is-loaded,
.gallery-card-media video.is-loaded { opacity: 1; }
.gallery-card:hover .gallery-card-media img,
.gallery-card:hover .gallery-card-media video { transform: scale(1.18); }
.gallery-card-media::after {
    content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3,3,5,0) 40%, rgba(3,3,5,0.95) 100%);
}

.gallery-card-body { padding: 1.75rem 2rem 2rem; transform: translateY(8px); opacity: 0.85; transition: transform 0.4s ease, opacity 0.4s ease; }
.showcase-card:hover .gallery-card-body { transform: translateY(0); opacity: 1; }

.gallery-cta-card { display: flex; align-items: center; justify-content: center; min-height: 420px; border: 1.5px dashed rgba(0, 242, 254, 0.35); background: rgba(0, 242, 254, 0.03); }
.gallery-cta-inner { text-align: center; padding: 2.5rem 2rem; }
.gallery-cta-card:hover { border-color: rgba(0, 242, 254, 0.7); background: rgba(0, 242, 254, 0.06); }

/* ===========================
   DEMO EMBED PANEL
=========================== */
.demo-panel { border-radius: 16px; overflow: hidden; border: 1px solid rgba(249, 250, 251, 0.1); background: rgba(3, 3, 5, 0.4); }
.demo-panel iframe { width: 100%; height: 560px; border: 0; display: block; background: #0a0a0f; }
.demo-panel-placeholder { padding: 2.5rem 2rem; text-align: center; }
.demo-panel-placeholder i { font-size: 2rem; color: rgba(74, 222, 128, 0.7); margin-bottom: 1rem; }

.gallery-nav-btn {
    position: absolute; top: 45%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background: rgba(10, 12, 18, 0.6);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(0, 242, 254, 0.35);
    color: var(--color-primary); z-index: 20; cursor: pointer; font-size: 1rem;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease, opacity 0.25s ease;
}
.gallery-nav-btn:hover { border-color: var(--color-primary); background: rgba(0, 242, 254, 0.14); transform: translateY(-50%) scale(1.08); }
.gallery-nav-btn:active { transform: translateY(-50%) scale(0.92); }
.gallery-nav-btn:disabled { opacity: 0.25; cursor: default; pointer-events: none; }
.gallery-nav-prev { left: 14px; }
.gallery-nav-next { right: 14px; }

.gallery-dots { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.25rem; }
.gallery-dot {
    width: 8px; height: 8px; border-radius: 50%; background: rgba(249, 250, 251, 0.15); border: none; padding: 0;
    cursor: pointer; transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
}
.gallery-dot:hover { background: rgba(0, 242, 254, 0.5); transform: scale(1.2); }
.gallery-dot.is-active { background: linear-gradient(90deg, var(--color-primary), var(--color-secondary)); width: 22px; border-radius: 4px; }

.gallery-controls-row { display: flex; align-items: center; justify-content: center; gap: 1rem; max-width: 320px; margin: 0 auto; }
.gallery-progress-track { flex: 1; height: 3px; border-radius: 2px; background: rgba(249, 250, 251, 0.1); overflow: hidden; }
.gallery-progress-fill { height: 100%; width: 0%; border-radius: 2px; background: linear-gradient(90deg, var(--color-primary), var(--color-secondary)); transition: width 0.1s linear; }
.gallery-counter-text { font-family: 'Fira Code', monospace; font-size: 11px; letter-spacing: 0.1em; color: #6b7280; white-space: nowrap; }

.gallery-expand-hint {
    position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(3, 3, 5, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(249, 250, 251, 0.15);
    color: var(--text-main); font-size: 0.75rem; opacity: 0; transform: scale(0.85); transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease; z-index: 5; pointer-events: none;
}
.gallery-card:hover .gallery-expand-hint { opacity: 1; transform: scale(1); border-color: rgba(0, 242, 254, 0.6); }

.gallery-swipe-hint { display: none; align-items: center; justify-content: center; gap: 0.5rem; color: #6b7280; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; font-family: 'Fira Code', monospace; margin-top: 0.75rem; }

/* Accessibility fix: Using visibility: hidden + opacity */
.gallery-lightbox {
    position: fixed; inset: 0; z-index: var(--z-lightbox); display: flex; align-items: center; justify-content: center;
    padding: 5vh 5vw; background: rgba(3, 3, 5, 0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.gallery-lightbox.open { opacity: 1; visibility: visible; pointer-events: auto; }
.gallery-lightbox-inner {
    max-width: 900px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; border-radius: 24px;
    overflow: hidden; border: 1px solid rgba(249, 250, 251, 0.1); background: rgba(10, 12, 18, 0.6); transform: scale(0.92) translateY(16px); transition: transform 0.35s var(--ease-out-cubic);
}
.gallery-lightbox.open .gallery-lightbox-inner { transform: scale(1) translateY(0); }
#gallery-lightbox-media { width: 100%; max-height: 65vh; background: var(--bg-dark); display: flex; align-items: center; justify-content: center; overflow: hidden; }
#gallery-lightbox-media img, #gallery-lightbox-media video { width: 100%; max-height: 65vh; object-fit: contain; }
.gallery-lightbox-caption { padding: 1.5rem 2rem 2rem; }
.gallery-lightbox-close {
    position: absolute; top: 24px; right: 24px; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(10, 12, 18, 0.6); border: 1px solid rgba(249, 250, 251, 0.15); color: var(--text-main); cursor: pointer; z-index: calc(var(--z-lightbox) + 1); transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
.gallery-lightbox-close:hover { border-color: rgba(0, 242, 254, 0.8); background: rgba(0, 242, 254, 0.12); transform: rotate(90deg); }
.gallery-lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(10, 12, 18, 0.6); border: 1px solid rgba(0, 242, 254, 0.35); color: var(--color-primary); cursor: pointer; z-index: calc(var(--z-lightbox) + 1); transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
.gallery-lightbox-nav:hover { border-color: var(--color-primary); background: rgba(0, 242, 254, 0.14); transform: translateY(-50%) scale(1.08); }
.gallery-lightbox-prev { left: 16px; }
.gallery-lightbox-next { right: 16px; }

.gallery-video-toggle {
    position: absolute; bottom: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(3, 3, 5, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(249, 250, 251, 0.2);
    color: var(--text-main); font-size: 0.8rem; cursor: pointer; z-index: 11; transition: border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}
.gallery-video-toggle:hover { border-color: var(--color-primary); color: var(--color-primary); transform: scale(1.1); }

[data-asset-check].is-unavailable { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.6); }
[data-asset-check].is-unavailable:hover { transform: none !important; }

/* ===========================
   MOBILE SLIDE-OUT MENU
=========================== */
.mobile-menu-backdrop {
    position: fixed; inset: 0; background: rgba(3,3,5,0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-mobile-backdrop); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.35s ease, visibility 0.35s ease;
}
.mobile-menu-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }

.mobile-menu {
    position: fixed; top: 0; right: 0; height: 100dvh; width: min(80vw, 360px); background: rgba(8,8,12,0.98);
    border-left: 1px solid rgba(249,250,251,0.1); z-index: var(--z-mobile-menu); transform: translateX(100%);
    visibility: hidden; transition: transform 0.4s var(--ease-out-cubic), visibility 0.4s ease; display: flex; flex-direction: column; justify-content: center; overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); visibility: visible; }

.mobile-menu-links { display: flex; flex-direction: column; gap: 0.5rem; padding: 2rem 2.5rem; }
.mobile-nav-link {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.35rem; font-weight: 600; letter-spacing: 0.02em; color: var(--text-main);
    padding: 0.85rem 0; border-bottom: 1px solid rgba(249,250,251,0.08); text-transform: uppercase; opacity: 0; transform: translateX(24px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.2s ease; text-decoration: none;
}
.mobile-menu.open .mobile-nav-link { opacity: 1; transform: translateX(0); }
.mobile-nav-link:hover, .mobile-nav-link:active { color: var(--color-primary); }
.mobile-nav-resume { margin-top: 1rem; border: 1px solid rgba(249,250,251,0.2); border-radius: 9999px; text-align: center; }

body.menu-open { overflow: hidden; }

/* Stagger animation delays for mobile menu items */
.mobile-menu-links .mobile-nav-link:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu-links .mobile-nav-link:nth-child(2) { transition-delay: 0.09s; }
.mobile-menu-links .mobile-nav-link:nth-child(3) { transition-delay: 0.13s; }
.mobile-menu-links .mobile-nav-link:nth-child(4) { transition-delay: 0.17s; }
.mobile-menu-links .mobile-nav-link:nth-child(5) { transition-delay: 0.21s; }
.mobile-menu-links .mobile-nav-link:nth-child(6) { transition-delay: 0.25s; }
.mobile-menu-links .mobile-nav-link:nth-child(7) { transition-delay: 0.29s; }
.mobile-menu-links .mobile-nav-link:nth-child(8) { transition-delay: 0.33s; }
.mobile-menu-links .mobile-nav-link:nth-child(9) { transition-delay: 0.37s; }

/* ===========================
   MOBILE OPTIMIZATION
=========================== */
@media (max-width: 900px) {
    .gallery-nav-btn { display: none; }
    .gallery-swipe-hint { display: flex; }
}

@media (max-width: 768px) {
    body { cursor: auto; overflow-x: hidden; }
    .cursor-dot, .cursor-ring { display: none !important; } 
    .glass-3d { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
    #hero-avatar { max-width: 320px; }
    .gallery-card { width: 85vw; margin: 0 !important; }
    .gallery-card-media { height: 38vh; }
    #journey .group { flex-direction: column !important; }
}

@media (hover: none) {
    .glass-3d:hover { transform: none; box-shadow: none; }
}

/* ========================================== */
/* ACCESSIBILITY: PREFERS REDUCED MOTION      */
/* ========================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .cursor-dot, .cursor-ring { display: none !important; }
    #gallery-pin {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    .gallery-card { scroll-snap-align: center; opacity: 1 !important; transform: scale(1) !important; }
    .loader-glitch::before, .loader-glitch::after { animation: none !important; }
}

/* ========================================== */
/* AI ASSISTANT CHATBOT WIDGET                */
/* ========================================== */
#chatbot-toggle {
    position: fixed; bottom: 92px; right: 24px; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)); color: var(--bg-dark); font-size: 1.4rem; border: none; cursor: pointer;
    z-index: var(--z-back-to-top); box-shadow: 0 10px 30px rgba(0, 242, 254, 0.35); transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#chatbot-toggle:hover { transform: scale(1.08); box-shadow: 0 14px 36px rgba(0, 242, 254, 0.5); }
#chatbot-toggle .chatbot-badge {
    position: absolute; top: -4px; right: -4px; background: var(--color-accent); color: var(--bg-dark); font-family: 'Fira Code', monospace;
    font-size: 8px; font-weight: 700; padding: 2px 6px; border-radius: 999px; letter-spacing: 0.05em; box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

#chatbot-panel {
    position: fixed; bottom: 96px; right: 24px; width: 380px; max-width: 92vw; height: 560px; max-height: 75vh; display: flex; flex-direction: column;
    background: rgba(8, 9, 14, 0.92); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--glass-border); border-radius: 24px; box-shadow: 0 30px 70px rgba(3, 3, 5, 0.6); z-index: calc(var(--z-back-to-top) + 1);
    opacity: 0; visibility: hidden; transform: translateY(24px) scale(0.96); pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease; overflow: hidden;
}
#chatbot-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }

.chatbot-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--glass-border); background: rgba(255,255,255,0.02); flex-shrink: 0; }
.chatbot-header-title { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--text-main); font-size: 0.95rem; }
.chatbot-header-title span.chatbot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 8px var(--color-accent); animation: pulseGlow 2s infinite; flex-shrink: 0; }
.chatbot-header-sub { display: block; font-family: 'Fira Code', monospace; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-top: 2px; }
#chatbot-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: color 0.2s ease, background 0.2s ease; flex-shrink: 0; }
#chatbot-close:hover { color: var(--color-primary); background: rgba(0,242,254,0.1); }

#chatbot-messages { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; font-size: 0.82rem; line-height: 1.55; }
.chatbot-msg { max-width: 90%; padding: 10px 14px; border-radius: 16px; white-space: pre-line; }
.chatbot-msg.bot { align-self: flex-start; background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border); color: var(--text-main); border-bottom-left-radius: 4px; }
.chatbot-msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)); color: var(--bg-dark); font-weight: 500; border-bottom-right-radius: 4px; }
.chatbot-msg a { color: inherit; text-decoration: underline; }
.chatbot-msg.bot a { color: var(--color-primary); }

.chatbot-typing { display: flex; gap: 4px; align-self: flex-start; padding: 12px 14px; background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border); border-radius: 16px; border-bottom-left-radius: 4px; }
.chatbot-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: chatbotBounce 1.2s infinite ease-in-out; }
.chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatbotBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

#chatbot-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; flex-shrink: 0; }
.chatbot-chip { font-family: 'Fira Code', monospace; font-size: 10px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--color-primary); background: rgba(0,242,254,0.08); border: 1px solid rgba(0,242,254,0.25); padding: 6px 10px; border-radius: 999px; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
.chatbot-chip:hover { background: rgba(0,242,254,0.18); border-color: rgba(0,242,254,0.5); }

#chatbot-input-row { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--glass-border); background: rgba(255,255,255,0.02); flex-shrink: 0; }
#chatbot-input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: 999px; padding: 10px 16px; color: var(--text-main); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.85rem; outline: none; transition: border-color 0.2s ease; min-width: 0; }
#chatbot-input:focus { border-color: rgba(0,242,254,0.5); }
#chatbot-send { width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)); color: var(--bg-dark); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; transition: transform 0.2s ease; flex-shrink: 0; }
#chatbot-send:hover { transform: scale(1.08); }
#chatbot-send:disabled { opacity: 0.5; cursor: default; transform: none; }

@media (max-width: 480px) {
    #chatbot-panel { right: 12px; left: 12px; width: auto; bottom: 88px; height: 68vh; }
    #chatbot-toggle { right: 16px; bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
    .chatbot-header-title span.chatbot-dot { animation: none; }
    .chatbot-typing span { animation: none; opacity: 0.7; }
}
 
