/* ----------------
 * Discord Card (Fixed Bottom Left)
 * ---------------- */
.discord-card {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1000;
    margin: 0;

    background: rgba(10, 5, 20, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(189, 0, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    width: 320px;
    text-align: left;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: all 0.4s var(--ease-smooth);
}

@media (max-width: 768px) {
    .discord-card {
        bottom: 1rem;
        left: 1rem;
        width: calc(100% - 2rem);
        /* Full width but with margins to look like a floating bar */
        max-width: 350px;
        padding: var(--space-3);
    }
}

.discord-card:hover {
    border-color: rgba(189, 0, 255, 0.5);
    transform: translateY(-5px);
}

.discord-card.minimized {
    width: 80px;
    height: 80px;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
}

.discord-card.minimized .card-header {
    border: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    height: 100%;
}

.discord-card.minimized .avatar-container {
    width: 60px;
    height: 60px;
    margin: 10px;
}

.discord-card.minimized .user-info,
.discord-card.minimized .activity-content,
.discord-card.minimized .card-toggle {
    display: none;
}

.card-toggle {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: all 0.2s;
}

.card-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ----------------
 * Projects Grid (No Carousel)
 * ---------------- */
.carousel-container {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    position: relative;
    padding: var(--space-4) 0;
}
.client-mode-toolbar {
    margin-top: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding: 0.68rem 0.9rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 15, 35, 0.4);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.client-mode-label {
    color: rgba(233, 228, 245, 0.88);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.client-mode-filters {
    display: flex;
    gap: var(--space-2);
    flex-wrap: nowrap;
}
.client-filter-btn {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: #f5f3ff;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    border-radius: var(--radius-pill);
    padding: 0.32rem 0.68rem;
    cursor: pointer;
    transition: all var(--transition-base);
}
.client-filter-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(189, 0, 255, 0.45);
    box-shadow: 0 0 14px rgba(189, 0, 255, 0.15);
}
.client-filter-btn.active {
    background: var(--violet);
    color: #fff;
    border-color: var(--violet);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

@media (max-width: 768px) {
    .client-mode-filters {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
    }

    .client-filter-btn {
        scroll-snap-align: start;
        flex-shrink: 0;
    }
}

.featured-metrics-panel {
    margin-top: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    background: rgba(20, 15, 35, 0.4);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    padding: var(--space-4);
}
.featured-metrics-head {
    color: #ddd6fe;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}
.featured-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}
.featured-metric-item {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
}
.featured-metric-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.32rem;
}
.featured-metric-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--violet-light);
}

/* ── PROJECTS GRID ── */
.carousel-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
    gap: var(--space-5);
    width: 100%;
    margin-top: 2.2rem;
}

.carousel-item[data-index="0"] {
    order: 1;
}

.carousel-item[data-index="7"] {
    order: 2;
}

.carousel-item[data-index="3"] {
    order: 3;
}

.carousel-item[data-index="4"] {
    order: 4;
}

.carousel-item[data-index="6"] {
    order: 5;
}

.carousel-item[data-index="1"] {
    order: 6;
}

.carousel-item[data-index="5"] {
    order: 7;
}

.carousel-item[data-index="2"] {
    order: 8;
}

@media (max-width: 768px) {
    .carousel-track {
        grid-template-columns: 1fr;
        gap: var(--space-5);
        margin-top: 2rem;
    }
}

.carousel-item {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: calc(var(--space-5) + 0.15rem);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur) saturate(160%);
    -webkit-backdrop-filter: var(--glass-blur) saturate(160%);
    transition: all 0.4s var(--ease-smooth);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-card);
}

.carousel-item.project-hidden {
    display: none;
}

@media (max-width: 768px) {
    .carousel-item {
        padding: var(--space-4);
        border-radius: var(--radius-md);
    }
}

.carousel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    /* Border thickness */
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(189, 0, 255, 0.3), transparent 40%, rgba(189, 0, 255, 0.1) 60%, rgba(189, 0, 255, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity .4s;
}

.carousel-item:hover {
    border-color: rgba(124, 58, 237, 0.45);
    transform: translateY(-3px) scale(1.01);
    box-shadow: var(--glow-hover);
}

.carousel-item:hover::before {
    opacity: 1;
}

.carousel-item i.bi {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0 auto 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    background: rgba(189, 0, 255, 0.1);
    border-radius: 10px;
    filter: drop-shadow(0 0 15px rgba(189, 0, 255, 0.4));
    transition: transform 0.4s;
}

.carousel-item:hover i.bi {
    transform: scale(1.1) rotate(5deg);
}

.carousel-item .project-meta {
    text-align: center;
    margin-bottom: 0.25rem;
    display: block;
    /* Ensure it takes full width to allow centering */
    font-size: 0.78rem;
}

.project-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 0 auto 0.65rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-family: var(--font-mono);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.08);
    color: #d9d4e7;
}

.project-status-badge[data-status="production"] {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.42);
}

.project-status-badge[data-status="testing"] {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.4);
}

.project-status-badge[data-status="creation"] {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.4);
}

.project-status-badge[data-status="archived"] {
    background: rgba(107, 114, 128, 0.24);
    color: #d1d5db;
    border-color: rgba(156, 163, 175, 0.36);
}

.modal-status-badge {
    margin: 0.35rem 0 0.55rem;
    font-size: 0.7rem;
}

.project-build-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 0 auto 0.6rem;
    padding: 0.16rem 0.48rem;
    border-radius: var(--radius-pill);
    font-size: 0.64rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: var(--font-mono);
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
}

.modal-build-badge {
    margin: 0 0 0.55rem;
    font-size: 0.68rem;
}

.carousel-item .project-title {
    text-align: center;
    font-size: 1.18rem;
    margin-bottom: 0.55rem;
    line-height: 1.3;
}

.carousel-item .project-desc {
    text-align: center;
    margin-bottom: 0.95rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(233, 228, 245, 0.9);
}

.carousel-item .tech-stack {
    justify-content: center;
    margin-bottom: 0.85rem;
}

.learn-more-btn {
    width: 100%;
    margin-top: auto;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    /* Centered */
    align-items: center;
    padding: var(--space-3) calc(var(--space-4) - 0.1rem);
    font-size: var(--text-sm);
    transition: all var(--transition-base);
}

.learn-more-btn:hover {
    background: rgba(189, 0, 255, 0.2);
    border-color: var(--primary);
    transform: none;
}

.carousel-item .hidden-details {
    display: none;
    /* Only for modal */
}

/* Carousel Nav */
.carousel-nav {
    display: none;
}

.carousel-dots {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    transition: all 0.25s ease;
    padding: 0;
}

.carousel-dot:hover {
    border-color: var(--primary);
    transform: scale(1.15);
}

.carousel-dot.active {
    width: 24px;
    border-radius: 999px;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(189, 0, 255, 0.6);
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px) scale(1.03);
}

.carousel-item:focus-visible,
.nav-btn:focus-visible,
.carousel-dot:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.perf-btn:focus-visible,
.lang-btn:focus-visible,
.skill-item:focus-visible,
.close-modal:focus-visible,
.close-terminal:focus-visible,
.card-toggle:focus-visible,
.hamburger-btn:focus-visible,
.nav-drawer-close:focus-visible,
.tl-toggle:focus-visible,
.back-to-top:focus-visible,
.search-item:focus-visible,
#projects-search:focus-visible,
#terminal-input:focus-visible {
    outline: 2px solid var(--violet);
    outline-offset: 3px;
}

/* ----------------
 * Modal (Custom Overlay)
 * ---------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 11000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(20, 10, 30, 0.95);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    /* Prevent overflow on small screens */
    overflow-y: auto;
    /* Scrollable content */
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    box-shadow: 0 0 24px rgba(189, 0, 255, 0.18);
    isolation: isolate;
    container-type: inline-size;
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    z-index: 10;
    padding: 0.2rem;
    /* Larger touch target */
}

.close-modal:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.modal-header {
    padding-right: var(--space-6);
    /* Prevent overlap with close button */
    margin-top: 0.2rem;
}

.modal-header h2 {
    font-size: clamp(1.12rem, 1.4cqi, 1.32rem);
    margin: 0 0 0.55rem 0;
    color: #fff;
    text-shadow: 0 0 20px rgba(189, 0, 255, 0.3);
    line-height: 1.2;
}

.modal-description {
    color: rgba(233, 228, 245, 0.95);
    font-size: clamp(0.92rem, 1cqi, 0.98rem);
    line-height: 1.65;
    margin-top: var(--space-1);
    text-align: left;
    /* Better readability */
}

.modal-description p {
    margin-bottom: var(--space-2);
}

.modal-description p:last-of-type {
    margin-bottom: 0;
}

.modal-description .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    padding: var(--space-3) calc(var(--space-6) - 0.2rem);
    border-radius: var(--radius-md);
}

.project-quality-badges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: var(--space-3);
}

.project-quality-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 10px;
    background: rgba(124, 58, 237, 0.08);
    color: #ddd6fe;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.project-quality-badge .quality-label {
    opacity: 0.75;
}

.project-quality-badge .quality-value {
    color: #fff;
    font-weight: 500;
}

.project-quality-badge.ok {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.14);
}

.project-quality-badge.warn {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.14);
}

@container (max-width: 420px) {
    .modal-description {
        line-height: 1.58;
    }

    .modal-description .btn {
        width: 100%;
    }
}

body.modal-open .cursor-dot,
body.modal-open .cursor-outline {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.modal-open * {
    cursor: auto !important;
}

@media (max-width: 600px) {
    .carousel-grid,
    .projects-grid,
    .carousel-track {
        grid-template-columns: 1fr;
    }

    .tech-pill {
        white-space: nowrap;
    }

    .featured-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .carousel-item {
        min-height: 0;
    }

    .carousel-item.active {
        transform: none !important;
    }

    .discord-card {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        width: auto;
        max-width: none;
    }

    /* Mobile Modal Tweaks */
    .modal-content {
        padding: var(--space-4);
        padding-top: 1.9rem;
        /* Space for close button */
        width: 95%;
        max-width: 400px;
    }

    .modal-header h2 {
        font-size: 1.12rem;
    }

    .close-modal {
        top: 0.35rem;
        right: 0.35rem;
        font-size: 1.5rem;
    }
}

/* ----------------
 * Performance Toggle & Mode
 * ---------------- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-left: 1.5rem;
}

.perf-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.perf-btn:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
    color: var(--violet-light);
    transform: translateY(-2px);
}

.perf-btn.active {
    background: var(--violet);
    border-color: var(--violet-light);
    color: #fff;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
    animation: pulse-perf 2s infinite;
}

#accessibilityToggle.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.logo-img {
    display: block;
}

.logo {
    position: relative;
    isolation: isolate;
}

body.motion-ready .logo {
    animation: logoFloat 5.5s ease-in-out infinite;
}

body.motion-ready .logo::after {
    content: '';
    position: absolute;
    inset: -6px -12px;
    border-radius: 999px;
    background: radial-gradient(circle at 40% 50%, rgba(124, 58, 237, 0.28), transparent 65%);
    filter: blur(10px);
    opacity: 0;
    transform: scale(0.8);
    animation: logoAura 3.2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

body.motion-ready .logo-img {
    transform-origin: 50% 50%;
    animation: logoScan 6.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

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

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

@keyframes logoAura {
    0%,
    100% {
        opacity: 0.2;
        transform: scale(0.84);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.04);
    }
}

@keyframes logoScan {
    0%,
    82%,
    100% {
        filter: drop-shadow(0 0 0 rgba(167, 139, 250, 0));
    }

    88% {
        filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.45));
    }

    92% {
        filter: drop-shadow(0 0 18px rgba(240, 171, 252, 0.55));
    }
}

.expertise-title {
    margin-bottom: 1.5rem;
    color: #fff;
    font-size: 1.2rem;
}

.expertise-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.expertise-item-title {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.expertise-icon {
    color: var(--primary);
}

.expertise-item-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.github-card-spaced {
    margin-top: 1.5rem;
}

.github-metrics-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.github-logo-icon {
    color: var(--violet-light);
}

.github-metrics-title {
    color: #fff;
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.learn-more-spaced {
    margin-top: 1.5rem;
}

.modal-meta-text {
    color: var(--primary);
}

.modal-action-space {
    margin-top: 2rem;
}

.donation-row {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-spacing {
    margin-top: 5rem;
}

.footer-heart {
    color: var(--primary);
}

@keyframes pulse-perf {
    0% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(124, 58, 237, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
    }
}

/* High Performance Mode Overrides */
body.perf-mode .mesh,
body.perf-mode .cursor-outline,
body.perf-mode ::before,
body.perf-mode ::after {
    animation: none !important;
    transition: none !important;
}

body.perf-mode .mesh {
    display: none !important;
}

body.perf-mode .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

body.perf-mode .card-3d {
    transform: none !important;
    transition: none !important;
}

body.perf-mode .motion-stagger {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

body.perf-mode .hero-content {
    animation: none !important;
    transform: none !important;
}

body.perf-mode .logo,
body.perf-mode .logo::after,
body.perf-mode .logo-img {
    animation: none !important;
    filter: none !important;
    transform: none !important;
}

body.perf-mode .motion-section,
body.perf-mode .motion-section::before,
body.perf-mode .motion-section .section-header,
body.perf-mode .motion-section .section-title,
body.perf-mode .motion-section .section-seo {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
}

/* ----------------
 * Navigation Overrides
 * ---------------- */
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ----------------
 * Search Overlay (Ctrl+K)
 * ---------------- */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 4, 10, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-overlay.open {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

.search-container {
    width: 90%;
    max-width: 600px;
    background: rgba(15, 12, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: slideDown 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.search-header {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 1rem;
    color: var(--violet-light);
}

.search-header input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1.1rem;
    flex: 1;
    font-family: inherit;
}

.search-kbd {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.search-item {
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.2rem;
}

.search-item:hover {
    background: rgba(124, 58, 237, 0.1);
}

.search-item.active {
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.search-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.search-info {
    flex: 1;
}

.search-info strong {
    display: block;
    color: #fff;
    font-size: 1rem;
}

.search-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }

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

/* ----------------
 * GitHub Metrics Card
 * ---------------- */
.gh-stats-grid {
    display: grid;
    grid-row-gap: 1.5rem;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 2rem;
}

.gh-stat-item {
    display: flex;
    flex-direction: column;
}

.gh-stat-value {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--violet-light);
    line-height: 1;
}

.gh-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.3rem;
}

.gh-lang-bar-container {
    display: flex;
    height: 8px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    gap: 2px;
    margin-bottom: 0.75rem;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
}

.gh-lang-bar-segment {
    height: 100%;
    transition: width 1s ease-in-out;
}

.gh-lang-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
}

.gh-lang-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.gh-api-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.65rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    font-family: var(--font-mono);
}

.gh-api-badge::before {
    content: '⚠';
    line-height: 1;
    opacity: 0.95;
}

.gh-lang-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ----------------
 * Typography & Elements
 * ---------------- */
.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar-container {
    position: relative;
    width: 50px;
    height: 50px;
}

#discord-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

#status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid rgba(20, 5, 30, 1);
    /* Matches card bg */
    background: #747f8d;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.username {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.2;
}

.status-text-scroller {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Activity Section */
.activity-content {
    min-height: 60px;
    display: flex;
    align-items: center;
}

.activity-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
}

.activity-stack .activity-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.45rem;
}

.activity-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.activity-row-main {
    display: flex;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.activity-interactive {
    cursor: pointer;
    border-radius: 10px;
    transition: border-color 0.25s var(--ease-smooth), background 0.25s var(--ease-smooth), transform 0.25s var(--ease-smooth);
}

.activity-interactive:hover {
    border-color: rgba(124, 58, 237, 0.35);
    background: rgba(124, 58, 237, 0.08);
    transform: translateY(-1px);
}

.activity-interactive:focus-visible {
    outline: 2px solid rgba(167, 139, 250, 0.85);
    outline-offset: 2px;
}

.activity-extra {
    margin-top: 0.65rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.activity-extra-title {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(221, 214, 254, 0.9);
    margin-bottom: 0.4rem;
}

.activity-meta {
    display: grid;
    gap: 0.32rem;
}

.activity-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.8rem;
    font-size: 0.74rem;
}

.activity-meta-label {
    color: rgba(233, 228, 245, 0.68);
    white-space: nowrap;
}

.activity-meta-value {
    color: rgba(233, 228, 245, 0.95);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-action {
    display: inline-flex;
    margin-top: 0.55rem;
    font-size: 0.74rem;
    color: #1db954;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.activity-action:hover {
    text-decoration: underline;
}

body.activity-popup-open {
    overflow: hidden;
}

.activity-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(5, 4, 10, 0.76);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.activity-popup-overlay.open {
    opacity: 1;
    visibility: visible;
}

.activity-popup {
    width: min(440px, 100%);
    max-height: min(80vh, 640px);
    overflow-y: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--primary);
    background: rgba(20, 10, 30, 0.95);
    box-shadow: 0 0 24px rgba(189, 0, 255, 0.18);
    padding: var(--space-5);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    isolation: isolate;
    container-type: inline-size;
}

.activity-popup-overlay.open .activity-popup {
    transform: scale(1);
}

.activity-popup-header {
    padding-right: var(--space-6);
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.7rem;
}

.activity-popup-title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.12rem, 1.4cqi, 1.32rem);
    text-shadow: 0 0 20px rgba(189, 0, 255, 0.3);
    line-height: 1.2;
}

.activity-popup-close {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
    padding: 0.2rem;
}

.activity-popup-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.activity-popup-body {
    color: rgba(233, 228, 245, 0.95);
    font-size: clamp(0.92rem, 1cqi, 0.98rem);
    line-height: 1.65;
    margin-top: var(--space-1);
    text-align: left;
}

.activity-popup-body .activity-meta {
    gap: 0.45rem;
}

.activity-popup-body .activity-meta-item {
    padding: 0.38rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.09);
    opacity: 0;
    transform: translateY(8px);
}

.activity-popup-body .activity-meta-item:last-child {
    border-bottom: none;
}

.activity-popup-body .activity-action {
    margin-top: 0.8rem;
    opacity: 0;
    transform: translateY(8px);
}

.activity-popup-overlay.open .activity-popup-body .activity-meta-item {
    animation: popupDetailStagger 360ms var(--ease-smooth) forwards;
    animation-delay: calc(var(--stagger-index, 0) * 55ms + 70ms);
}

.activity-popup-overlay.open .activity-popup-body .activity-action {
    animation: popupDetailStagger 360ms var(--ease-smooth) forwards;
    animation-delay: 210ms;
}

@keyframes popupDetailStagger {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

@media (max-width: 600px) {
    .activity-popup {
        padding: var(--space-4);
        padding-top: 1.9rem;
        width: 95%;
        max-width: 400px;
    }

    .activity-popup-title {
        font-size: 1.12rem;
    }

    .activity-popup-close {
        top: 0.35rem;
        right: 0.35rem;
    }
}

.activity-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.activity-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    gap: 2px;
}

.act-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.nav-links a {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-links a i {
    font-size: 1rem;
    transition: all 0.3s;
    color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

.nav-links a:hover i,
.nav-links a.active i {
    color: var(--primary);
    transform: translateY(-2px);
    filter: drop-shadow(0 0 5px var(--primary));
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 1.25rem;
    right: 0;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    border-radius: 2px;
}

.act-details {
    font-size: 0.8rem;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.act-state {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.spotify-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.spotify-progress {
    height: 100%;
    background: #1db954;
    width: 0%;
    transition: width 1s linear;
}

h1 {
    font-size: clamp(2.1rem, 7vw, 5.2rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
    color: #fff;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

h1 .highlight-text {
    background: linear-gradient(to right, #fff, #d000ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 3.5rem;
    font-weight: 300;
    line-height: 1.6;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    color: var(--violet-light);
    margin-bottom: 2rem;
    padding: 0.4rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    background: var(--glass-bg);
}

.hero-tag:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.4);
}

.hero-sub {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--text-muted);
    max-width: 640px;
    margin: 1.5rem auto 2.5rem;
    line-height: 1.75;
}

.live-visitors {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.78rem;
    border-radius: 100px;
    font-size: 0.8rem;
    color: #cde8ff;
    background: none;
    border: 1px solid rgba(96, 165, 250, 0.35);
    backdrop-filter: blur(10px);
    position: relative;
    margin-bottom: 0;
    box-shadow: none;
}

.live-visitors i {
    font-size: 0.9rem;
    color: #7dd3fc;
}

@media (max-width: 768px) {
    .live-visitors {
        font-size: 0.75rem;
        margin-bottom: 1.2rem;
        padding: 0.5rem 0.9rem;
    }
}

.cta-group {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

/* ── HERO STAGGER ── */
/* Stagger driven by --reveal-order via initMotionEnhancements + body.motion-ready .hero-content .reveal */

/* ----------------
 * Buttons
 * ---------------- */
.btn {
    padding: var(--space-4) calc(var(--space-6) + 1rem);
    border-radius: var(--radius-pill);
    font-weight: 600;
    transition: all 0.4s var(--ease-smooth);
    position: relative;
    overflow: hidden;
    font-size: var(--text-base);
    letter-spacing: 0.5px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    min-width: 220px;
    min-height: 56px;
}

.btn i {
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.btn:hover i {
    transform: translateX(3px) translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    box-shadow: 0 0 20px rgba(189, 0, 255, 0.4);
}

.btn-primary:hover {
    background: #a000db;
    box-shadow: var(--glow-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    min-width: 220px;
    min-height: 56px;
}

#projects-search::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Hint for commands */
.search-container::after {
    content: 'Type ">" for commands';
    position: absolute;
    bottom: 1rem;
    left: 1.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    transform: translateY(-3px);
}

.btn-sm {
    padding: var(--space-2) var(--space-5);
    font-size: var(--text-sm);
    border-radius: var(--radius-xl);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.bi-arrow-repeat.spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* ----------------
 * Marquee
 * ---------------- */
.marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

/* Marquee Styles simplified */

.marquee-content i.bi-layout-wtf {
    color: var(--primary);
}

.marquee:hover .marquee-anim {
    animation-play-state: paused;
}

.marquee-content {
    display: flex;
    width: max-content;
    align-items: center;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    width: 200px;
    /* Fixed width for consistent hitboxes */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    gap: 1rem;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.skill-item i {
    font-size: 3.5rem;
    transition: all 0.4s ease;
    opacity: 0.6;
    filter: grayscale(1) brightness(0.8);
}

.skill-name {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: absolute;
    /* Absolute to prevent pushing icon */
    bottom: 5px;
    opacity: 0;
    transition: all 0.4s ease;
    transform: translateY(10px);
}

.skill-item:hover {
    background: rgba(189, 0, 255, 0.05);
    border-radius: 20px;
    transform: scale(1.1);
}

.skill-item:hover i {
    opacity: 1;
    filter: grayscale(0) brightness(1.2) drop-shadow(0 0 15px currentColor);
    transform: translateY(-5px);
}

.skill-item:hover .skill-name {
    opacity: 1;
    transform: translateY(0);
}

/* Fix for dark Vercel icon */
.vercel-icon {
    filter: invert(1) brightness(2) !important;
}

.skill-item:hover .vercel-icon {
    filter: invert(1) brightness(2.5) drop-shadow(0 0 15px #fff) !important;
}

.marquee-anim {
    animation: marquee-scroll 40s linear infinite;
}

@keyframes marquee-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* ----------------
 * Projects Section
 * ---------------- */
.section {
    padding: 4.2rem 0;
    position: relative;
    z-index: 2;
    content-visibility: auto;
    contain-intrinsic-size: 1px 820px;
}

.section::after {
    content: none;
    pointer-events: none;
}

.section + .section {
    border-top: 0;
}

body.motion-ready .motion-section {
    opacity: 0.62;
    transform: translateY(28px) scale(0.986);
    transition: opacity 720ms var(--ease-smooth), transform 720ms var(--ease-smooth);
}

body.motion-ready .motion-section::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 1px;
    background: transparent;
    opacity: 0;
    transform: scaleX(0.35);
    transition: opacity 680ms var(--ease-smooth), transform 680ms var(--ease-smooth);
    pointer-events: none;
}

body.motion-ready .motion-section .section-header,
body.motion-ready .motion-section .section-title,
body.motion-ready .motion-section .section-seo {
    transition: transform 720ms var(--ease-smooth), opacity 720ms var(--ease-smooth), filter 720ms var(--ease-smooth);
}

body.motion-ready .motion-section .section-header {
    transform: translateY(16px);
    opacity: 0.68;
}

body.motion-ready .motion-section .section-title {
    transform: translateY(20px);
    opacity: 0.65;
    filter: blur(1.5px);
}

body.motion-ready .motion-section .section-seo {
    transform: translateY(14px);
    opacity: 0.72;
}

body.motion-ready .motion-section.motion-visible {
    opacity: 1;
    transform: none;
}

body.motion-ready .motion-section.motion-visible::before {
    opacity: 0.95;
    transform: scaleX(1);
}

body.motion-ready .motion-section.motion-visible .section-header,
body.motion-ready .motion-section.motion-visible .section-title,
body.motion-ready .motion-section.motion-visible .section-seo {
    transform: none;
    opacity: 1;
    filter: blur(0);
}

.section-header {
    margin-bottom: 2rem;
}

.section-tag {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 0.65rem;
    display: block;
}

.section-title {
    font-size: clamp(1.9rem, 4.2vw, 3rem);
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: #fff;
    line-height: 1.3;
    padding-bottom: 0.2em;
    /* Extra space for descenders */
}

.section-seo {
    max-width: 78ch;
    margin-top: -0.45rem;
    margin-bottom: 1rem;
    color: rgba(233, 228, 245, 0.78);
    font-size: 0.88rem;
    line-height: 1.65;
}


.card-3d {
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 2.5rem;
    transition: all 0.1s ease;
    transform-style: preserve-3d;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Subtle box shadow */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.card-3d:hover {
    border-color: var(--violet-light);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
    background: rgba(30, 30, 30, 0.6);
}

/* ── REVEAL ANIMATION ── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .7s ease, transform .7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

body.motion-ready .hero-content {
    animation: heroIntro 850ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.motion-ready .hero-content .reveal {
    transition-delay: calc(var(--reveal-order, 0) * 90ms);
}

.motion-stagger {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    transition: opacity 650ms var(--ease-smooth), transform 650ms var(--ease-smooth);
    transition-delay: calc(var(--stagger-index, 0) * 55ms);
}

.motion-stagger.motion-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.carousel-item {
    will-change: transform, box-shadow;
}

.carousel-item::after {
    content: '';
    position: absolute;
    inset: -40% -10%;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.85s var(--ease-smooth);
    pointer-events: none;
}

.carousel-item:hover::after {
    transform: translateX(120%);
}

@keyframes heroIntro {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.985);
        filter: blur(6px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* ----------------
 * GitHub Modal Stats & Hero Availability
 * ---------------- */
.gh-modal-stats {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.gh-modal-stat {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: rgba(221, 214, 254, 0.95);
}

.gh-modal-stat svg {
    opacity: 0.7;
}

#hero-availability {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.quick-tour-indicator {
    position: fixed;
    top: 5.6rem;
    right: 1.2rem;
    z-index: 1200;
    padding: 0.55rem 0.78rem;
    .quick-tour-head {
        display: flex;
        align-items: center;
        gap: 0.7rem;
    }
    .quick-tour-text {
        white-space: nowrap;
    }
    .quick-tour-skip-btn {
        border: 1px solid rgba(125, 211, 252, 0.4);
        background: rgba(125, 211, 252, 0.14);
        color: #e0f2fe;
        font-family: var(--font-mono);
        font-size: 0.64rem;
        border-radius: var(--radius-pill);
        padding: 0.2rem 0.5rem;
        cursor: pointer;
    }
    .quick-tour-progress {
        width: 100%;
        height: 4px;
        margin-top: 0.5rem;
        border-radius: var(--radius-pill);
        background: rgba(255, 255, 255, 0.12);
        overflow: hidden;
    }
    .quick-tour-progress-fill {
        width: 0%;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #22d3ee, #a78bfa);
        transition: width 0.24s ease;
    }
    border-radius: var(--radius-pill);
    border: 1px solid rgba(125, 211, 252, 0.4);
    background: rgba(6, 11, 24, 0.82);
    color: #e0f2fe;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.quick-tour-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

#projects.quick-tour-focus,
#contact.quick-tour-focus {
    scroll-margin-top: 5.6rem;
    animation: quickTourPulse 1.2s ease-in-out 1;
}

@keyframes quickTourPulse {
    0% {
        filter: drop-shadow(0 0 0 rgba(125, 211, 252, 0));
    }

    40% {
        filter: drop-shadow(0 0 22px rgba(125, 211, 252, 0.28));
    }

    100% {
        filter: drop-shadow(0 0 0 rgba(125, 211, 252, 0));
    }
}

/* ----------------
 * Contact Form
 * ---------------- */
.contact-form-container {
    max-width: none;
    margin: 0;
    text-align: left;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: var(--space-6);
    align-items: start;
    margin-top: var(--space-6);
}

.contact-social-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: stretch;
}

.contact-link-main {
    white-space: nowrap;
}

.response-time-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    width: fit-content;
    padding: 0.42rem 0.72rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(125, 211, 252, 0.35);
    background: rgba(14, 165, 233, 0.12);
    color: rgba(224, 242, 254, 0.95);
    font-size: 0.78rem;
    font-family: var(--font-mono);
}

.response-time-pill i {
    color: #7dd3fc;
}

.contact-discord-group {
    display: flex;
    gap: var(--space-4);
}

.contact-smart-panel {
    margin-top: var(--space-3);
    padding: var(--space-5);
    border: 1px solid rgba(124, 58, 237, 0.24);
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, rgba(24, 17, 38, 0.72), rgba(14, 11, 24, 0.78));
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.contact-smart-head h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.06rem;
    color: #fff;
}

.contact-smart-head p {
    margin-top: var(--space-2);
    color: rgba(233, 228, 245, 0.8);
    font-size: 0.84rem;
}

.availability-block {
    margin-top: var(--space-4);
}

.availability-label,
.templates-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(167, 139, 250, 0.95);
    font-family: var(--font-mono);
}

.availability-slots {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.slot-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(167, 139, 250, 0.34);
    background: rgba(124, 58, 237, 0.15);
    color: #ddd6fe;
    font-size: 0.74rem;
    font-family: var(--font-mono);
}

.smart-call-btn {
    width: 100%;
    margin-top: var(--space-4);
    border-radius: var(--radius-md);
}

.message-templates {
    margin-top: var(--space-4);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
}

.template-btn {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(233, 228, 245, 0.95);
    font-family: var(--font-mono);
    font-size: 0.73rem;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.55rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.template-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(167, 139, 250, 0.45);
    background: rgba(124, 58, 237, 0.15);
    color: #fff;
}

.template-btn:focus-visible {
    outline: 2px solid var(--violet-light);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .contact-smart-panel {
        padding: var(--space-4);
    }

    .template-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    position: relative;
    margin-bottom: var(--space-6);
}

.form-group input,
.form-group textarea {
    width: 100%;
}

#contact-form .form-group {
    margin-bottom: 2rem;
}

.form-group.field-error input,
.form-group.field-error textarea {
    border-color: #f87171;
}

.form-group.field-error::after {
    content: attr(data-error-msg);
    display: block;
    font-size: 0.75rem;
    color: #f87171;
    margin-top: 0.25rem;
    font-family: var(--font-mono);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    font-size: var(--text-base);
    transition: all var(--transition-base);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2), 0 0 16px rgba(124, 58, 237, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group label {
    position: absolute;
    left: var(--space-4);
    top: var(--space-4);
    color: var(--text-muted);
    pointer-events: none;
    transition: all var(--transition-base);
}

.form-group input:focus+label,
.form-group textarea:focus+label,
.form-group input:not(:placeholder-shown)+label,
.form-group textarea:not(:placeholder-shown)+label {
    top: -0.6rem;
    left: var(--space-3);
    font-size: var(--text-sm);
    color: var(--primary);
    background: #0d0c12;
    padding: 0 var(--space-2);
}

.form-feedback {
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    display: none;
}

.form-feedback.success {
    display: block;
    color: #4ade80;
}

.form-feedback.error {
    display: block;
    color: #f87171;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.25s var(--ease-smooth);
    width: 100%;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.contact-link:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.4);
    color: #fff;
    box-shadow: var(--glow-hover);
    transform: translateX(4px);
}

.contact-link .icon {
    font-size: 1.1rem;
    color: var(--violet-light);
    flex-shrink: 0;
}

/* ── TIMELINE ── */
.timeline {
    margin-top: calc(var(--space-6) + var(--space-4));
    position: relative;
    padding-left: 0;
    /* Suppression de l'espace pour la ligne et les points */
}

.timeline::before {
    content: none;
}

.tl-item {
    position: relative;
    margin-bottom: calc(var(--space-6) + var(--space-5));
    text-align: left;
    padding-left: 0;
    z-index: 1;
}

@media (max-width: 768px) {
    .tl-item {
        margin-bottom: 3.5rem;
    }
}

.tl-item::before {
    content: none;
}

/* Color coding by type */

.tl-item[data-type="personal"]::before   { background: var(--violet); }
.tl-item[data-type="school"]::before     { background: var(--accent); }
.tl-item[data-type="internship"]::before { background: var(--violet-light); }

.tl-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-2);
}

.tl-date {
    font-size: .72rem;
    color: var(--violet-light);
    letter-spacing: .08em;
    font-family: var(--font-mono);
}

.tl-company {
    font-size: .72rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: .2rem .7rem;
    font-family: var(--font-mono);
}

.tl-role {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-3);
    color: #fff;
    line-height: 1.4;
}

.tl-desc {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.75;
}

.tl-toggle {
    display: none;
}

/* Desktop: always show desc */
@media (min-width: 769px) {
    .tl-desc {
        max-height: none !important;
    }
    .tl-toggle {
        display: none;
    }
}

.card-content {
    transform: translateZ(30px);
    display: flex;
    /* New */
    flex-direction: column;
    /* New */
    height: 100%;
    /* New */
    justify-content: space-between;
    /* New */
}

.project-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}


.project-title {
    font-size: 1.55rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: #fff;
    line-height: 1.3;
    padding-bottom: 0.1em;
}

.project-desc {
    color: var(--text-muted);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

.tech-stack {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-6);
}

.tech-pill {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: var(--violet-pale);
    transition: background 0.2s, border-color 0.2s;
}

.card-3d:hover .tech-pill {
    background: rgba(124, 58, 237, 0.25);
    border-color: rgba(124, 58, 237, 0.5);
    color: var(--violet-pale);
}

.carousel-item:hover .tech-pill {
    background: rgba(124, 58, 237, 0.25);
    border-color: rgba(124, 58, 237, 0.5);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 500;
    transition: gap 0.3s, color 0.3s;
}

.project-link:hover {
    gap: 1rem;
    color: var(--primary);
}

/* ----------------
 * Bio Section
 * ---------------- */
.bio-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 5rem;
    align-items: flex-start;
}

.big-text {
    font-size: clamp(1.1rem, 1.4vw, 1.3rem);
    line-height: 1.85;
    color: rgba(233, 228, 245, 0.85);
}

.highlight {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-underline-offset: 10px;
    /* More offset for cleaner look */
    font-weight: 600;
}

.glass-panel {
    padding: var(--space-6);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.3s var(--ease-smooth);
}
.glass-panel:hover {
    box-shadow: var(--glow-hover);
}

/* ----------------
 * Footer
 * ---------------- */
.footer-cta {
    padding: 5rem 0;
    position: relative;
    z-index: 2;
}

.contact-inner {
    padding: 3rem var(--space-6);
    text-align: center;
    position: relative;
}

.contact-inner::before {
    display: none;
}

.email-display {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: #fff;
    transition: color var(--transition-base);
}

.email-display:hover {
    color: var(--primary);
}

footer {
    padding-bottom: var(--space-6);
    color: #555;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    margin-top: 3rem;
}

/* ----------------
 * Optional Ultra Compact Mode
 * ---------------- */
body.ultra-compact .carousel-track {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
}

body.ultra-compact .carousel-item {
    padding: var(--space-4);
}

body.ultra-compact .carousel-item .project-title {
    font-size: 1.03rem;
}

body.ultra-compact .carousel-item .project-desc {
    font-size: 0.86rem;
    line-height: 1.45;
}

body.ultra-compact .modal-content {
    max-width: 500px;
    padding: var(--space-4);
}

body.ultra-compact .modal-description {
    font-size: 0.9rem;
    line-height: 1.55;
}

/* ----------------
 * Responsive
 * ---------------- */
@media (max-width: 900px) {

    .grid-3d,
    .bio-grid {
        grid-template-columns: 1fr;
    }

    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }

    * {
        cursor: auto !important;
    }

    .card-3d {
        transform: none !important;
    }

    .container {
        padding: 0 1.25rem;
    }

    header {
        padding: 1.2rem 0;
        background: rgba(5, 2, 9, 0.95);
        backdrop-filter: blur(30px);
        border-bottom: 1px solid var(--border);
    }

    header.scrolled {
        padding: 0.95rem 0;
    }

    .logo {
        font-size: 1.2rem;
    }

    nav {
        gap: 0.75rem;
        align-items: center;
        flex-direction: row;
        /* Keep logo and nav actions on same line if possible */
        justify-content: space-between;
    }

    .nav-right {
        margin-left: auto;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .nav-links {
        display: none;
        /* Hide menu on mobile */
    }

    .hero {
        min-height: 100vh;
        padding: 9.4rem 0 4.8rem;
        display: flex;
        align-items: center;
    }

    .hero-content {
        padding: 0 1.25rem;
    }

    h1 {
        font-size: clamp(1.6rem, 10vw, 3.3rem);
        margin-bottom: 1.5rem;
    }

    .hero p {
        font-size: 0.98rem;
        margin-bottom: 2.6rem;
        line-height: 1.7;
        color: var(--text-muted);
    }

    .cta-group {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .cta-group .btn {
        width: 100%;
        justify-content: center;
    }

    .section {
        padding: 3.5rem 0;
    }

    .section-header {
        margin-bottom: 1.7rem;
    }

    .section-tag {
        margin-bottom: 0.55rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .project-title {
        font-size: 1.6rem;
    }

    /* Disable some complex hover effects on touch for performance */
    .carousel-item:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    .skill-item:hover {
        transform: none;
    }

    .big-text {
        font-size: 1.02rem;
        line-height: 1.65;
        margin-bottom: 1.2rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .footer-cta {
        padding: 4rem 0 3rem;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .contact-link-main {
        white-space: normal;
    }

    .contact-discord-group {
        flex-wrap: wrap;
    }

    .email-display {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 1rem;
    }

    nav {
        flex-direction: row;
        align-items: center;
    }

    .nav-right {
        width: auto;
        align-items: center;
    }

    .nav-links {
        display: none;
    }

    .lang-switch {
        align-self: center;
        margin-left: 0.5rem;
        /* Small gap from performance btn */
    }

    .btn {
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section-header {
        margin-bottom: 1.25rem;
    }

    .section-title {
        font-size: 1.7rem;
        margin-bottom: 0.8rem;
    }

    .big-text {
        font-size: 0.98rem;
        line-height: 1.6;
    }

    .timeline {
        padding-left: 1.3rem;
    }

    .tl-item::before {
        left: -1.6rem;
    }

    .carousel-track {
        grid-template-columns: 1fr;
    }

    .contact-link {
        width: 100%;
        justify-content: center;
    }

    /* Keep fixed status card compact on phones to avoid covering content. */
    .discord-card {
        left: 0.6rem;
        right: 0.6rem;
        bottom: 0.6rem;
        width: auto;
        max-width: none;
        padding: 0.65rem 0.75rem;
        border-radius: 14px;
    }

    .discord-card .card-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .discord-card .activity-content {
        display: none;
    }

    #status-indicator {
        width: 12px;
        height: 12px;
    }

    main {
        padding-bottom: 7.5rem;
    }
}

.cursor-outline {
    display: none !important;
}

.skill-modal-content {
    max-width: 640px;
}

/* ----------------
 * Reading Progress Bar
 * ---------------- */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--violet-light));
    z-index: 10000;
    transition: width 0.1s ease-out;
}

/* ----------------
 * Interactive Terminal
 * ---------------- */
.terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 2, 9, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.terminal-overlay.open {
    display: flex;
    animation: searchFadeIn 0.3s ease;
}

.terminal-container {
    width: 100%;
    max-width: 800px;
    height: 500px;
    background: rgba(10, 5, 20, 0.95);
    border: 1px solid var(--primary);
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
}

.terminal-header {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-dots {
    display: flex;
    gap: 0.5rem;
}

.terminal-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.terminal-dots span:nth-child(1) {
    background: #ff5f56;
}

.terminal-dots span:nth-child(2) {
    background: #ffbd2e;
}

.terminal-dots span:nth-child(3) {
    background: #27c93f;
}

.close-terminal {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: 0.2s;
}

.close-terminal:hover {
    opacity: 1;
    color: var(--primary);
}

.terminal-output {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    font-size: 0.96rem;
    line-height: 1.6;
    color: #fff;
    scroll-behavior: smooth;
}

.terminal-line {
    margin-bottom: 0.5rem;
}

.terminal-line.cmd {
    color: var(--primary);
    font-weight: 500;
}

.terminal-line.error {
    color: #ff4b4b;
}

.terminal-line.success {
    color: #27c93f;
}

.terminal-input-row {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.terminal-input-row .prompt {
    color: var(--primary);
    font-weight: bold;
}

#terminal-input {
    background: none;
    border: none;
    color: #fff;
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
}

/* ── HAMBURGER BUTTON ── */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    z-index: 1001;
}

.hamburger-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.25s var(--ease-smooth), opacity 0.2s;
}

body.nav-open .hamburger-btn .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.nav-open .hamburger-btn .hamburger-bar:nth-child(2) {
    opacity: 0;
}
body.nav-open .hamburger-btn .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── NAV DRAWER ── */
.nav-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
}

.nav-drawer[aria-hidden="false"] {
    display: block;
}

.nav-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s ease;
}

.nav-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(280px, 85vw);
    height: 100%;
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: slideInRight 0.25s var(--ease-smooth);
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.nav-drawer-close {
    align-self: flex-end;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.nav-drawer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-drawer-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: color 0.2s, background 0.2s;
}

.nav-drawer-links a:hover,
.nav-drawer-links a.active {
    color: var(--text-main);
    background: rgba(124, 58, 237, 0.12);
}

.nav-drawer-lang {
    margin-top: auto;
}

@media (prefers-reduced-motion: reduce) {
    .nav-drawer-overlay,
    .nav-drawer-panel {
        animation: none;
    }
    .hamburger-bar {
        transition: none;
    }
}

/* ----------------
 * Mobile Rebuild Layer
 * ---------------- */
@media (max-width: 768px) {
    :root {
        --mobile-edge-gap: max(1rem, env(safe-area-inset-left));
    }

    html,
    body {
        overflow-x: hidden;
    }

    .hamburger-btn {
        display: flex;
    }

    .container {
        width: 100%;
        padding-left: var(--mobile-edge-gap);
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    header {
        padding: 0.92rem 0;
        background: rgba(5, 2, 9, 0.92);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border);
    }

    header.scrolled {
        padding: 0.74rem 0;
    }

    nav {
        min-height: 46px;
        gap: 0.5rem;
    }

    .logo img {
        height: 40px !important;
        width: auto;
    }

    .nav-right {
        gap: 0.55rem;
    }

    .nav-actions {
        margin-left: 0;
        gap: 0.5rem;
    }

    .perf-btn {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .lang-switch {
        padding: 0.2rem;
    }

    .lang-btn {
        font-size: 0.68rem;
        padding: 0.22rem 0.5rem;
    }

    .hero {
        min-height: auto;
        padding: 7.4rem 0 3rem;
    }

    .quick-tour-indicator {
        top: 4.8rem;
        right: 0.8rem;
        max-width: calc(100vw - 1.4rem);
        font-size: 0.68rem;
    }

    .hero-content {
        max-width: 100%;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-tag,
    .live-visitors {
        margin-bottom: 1.1rem;
    }

    h1 {
        font-size: clamp(1.6rem, 7.2vw, 2.25rem);
        line-height: 1.12;
        margin-bottom: 0.9rem;
    }

    .hero-sub,
    .hero p {
        font-size: 0.93rem;
        line-height: 1.6;
        margin-bottom: 1.2rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .cta-group {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.6rem;
        width: 100%;
    }

    .cta-group .btn,
    .btn {
        width: calc(100% - 0.2rem);
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
        padding: 0.78rem 0.95rem;
        font-size: 0.9rem;
        border-radius: 12px;
    }

    .marquee {
        margin-top: 0.4rem;
    }

    .skill-item {
        min-height: 34px;
        padding: 0.3rem 0.55rem;
    }

    .section {
        padding: 2.8rem 0;
    }

    .section-header {
        margin-bottom: 1.25rem;
    }

    .section-tag {
        font-size: 0.74rem;
        margin-bottom: 0.35rem;
    }

    .section-title {
        font-size: clamp(1.45rem, 6vw, 1.85rem);
        line-height: 1.2;
        margin-bottom: 0.45rem;
    }

    .section-seo {
        font-size: 0.8rem;
        line-height: 1.55;
        margin-top: 0;
        margin-bottom: 0.72rem;
    }

    .project-build-badge {
        font-size: 0.58rem;
        margin-bottom: 0.38rem;
        padding: 0.13rem 0.38rem;
    }

    .modal-build-badge {
        font-size: 0.62rem;
        margin-bottom: 0.42rem;
    }

    .bio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .bio-grid > * {
        width: 100%;
    }

    .contact-layout,
    .grid-3d {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .big-text {
        font-size: 0.92rem;
        line-height: 1.62;
    }

    .glass-panel,
    .card-3d {
        border-radius: 14px;
        padding: 0.95rem;
    }

    .timeline {
        margin-top: 1.25rem;
        padding-left: 1.05rem;
    }

    .tl-item {
        margin-bottom: 1.45rem;
    }

    .tl-item::before {
        left: -1.36rem;
        width: 8px;
        height: 8px;
    }

    .tl-role {
        font-size: 0.98rem;
        margin-bottom: 0.35rem;
    }

    .tl-desc {
        font-size: 0.84rem;
        line-height: 1.58;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s var(--ease-smooth);
    }

    .tl-item.expanded .tl-desc {
        max-height: 300px;
    }

    .tl-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        margin-top: 0.25rem;
        font-size: 0.75rem;
        color: var(--violet-light);
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        font-family: var(--font-mono);
    }

    @media (prefers-reduced-motion: reduce) {
        .tl-desc {
            transition: none;
        }
    }

    .carousel-container {
        padding: 0;
    }

    .carousel-track,
    body.ultra-compact .carousel-track {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-top: 1.1rem;
    .featured-metrics-grid {
        grid-template-columns: 1fr;
    }
    }

    .carousel-item,
    body.ultra-compact .carousel-item {
        border-radius: 14px;
        padding: 0.9rem;
    }

    .carousel-item i.bi {
        width: 36px;
        height: 36px;
        margin-bottom: 0.5rem;
        font-size: 1.2rem;
    }

    .carousel-item .project-meta {
        font-size: 0.68rem;
        margin-bottom: 0.2rem;
    }

    .project-status-badge {
        margin-bottom: 0.45rem;
        font-size: 0.62rem;
        padding: 0.14rem 0.44rem;
    }

    .carousel-item .project-title,
    body.ultra-compact .carousel-item .project-title {
        font-size: 1rem;
        margin-bottom: 0.42rem;
        line-height: 1.28;
    }

    .carousel-item .project-desc,
    body.ultra-compact .carousel-item .project-desc {
        font-size: 0.84rem;
        line-height: 1.5;
        margin-bottom: 0.65rem;
    }

    .carousel-item .tech-stack {
        margin-bottom: 0.7rem;
        gap: 0.42rem;
    }

    .tech-pill {
        font-size: 0.68rem;
        padding: 0.26rem 0.45rem;
        border-radius: 7px;
    }

    .learn-more-btn {
        min-height: 36px;
        margin-top: 0.2rem !important;
        margin-left: auto;
        margin-right: auto;
        font-size: 0.82rem;
        padding: 0.52rem 0.75rem;
    }

    .modal-content,
    body.ultra-compact .modal-content,
    .skill-modal-content {
        width: calc(100% - 1.6rem);
        max-width: none;
        border-radius: 14px;
        padding: 0.9rem;
        padding-top: 1.8rem;
        max-height: 88vh;
    }

    .modal-header {
        padding-right: 1.2rem;
        margin-top: 0;
    }

    .modal-header h2 {
        font-size: 1.05rem;
        margin-bottom: 0.4rem;
    }

    .modal-status-badge {
        margin-top: 0.15rem;
        margin-bottom: 0.45rem;
    }

    .modal-description,
    body.ultra-compact .modal-description {
        font-size: 0.88rem;
        line-height: 1.56;
        margin-top: 0;
    }

    .gh-modal-stats {
        margin-top: 0.8rem;
        padding-top: 0.75rem;
        gap: 0.6rem;
    }

    .project-quality-badges {
        grid-template-columns: 1fr;
        gap: 0.35rem;
        margin-top: 0.6rem;
    }

    .project-quality-badge {
        font-size: 0.7rem;
        padding: 0.4rem 0.52rem;
    }

    .gh-modal-meta-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .gh-modal-stat {
        font-size: 0.84rem;
    }

    .gh-lang-labels {
        gap: 0.4rem 0.65rem;
    }

    .gh-lang-label {
        font-size: 0.7rem;
    }

    .contact-inner {
        padding: 1.2rem 0.45rem;
    }

    .form-group {
        margin-bottom: 0.9rem;
    }

    .form-group input,
    .form-group textarea {
        font-size: 0.9rem;
        padding: 0.78rem;
        border-radius: 10px;
    }

    .form-group textarea {
        min-height: 110px;
    }

    .contact-link {
        width: 100%;
        justify-content: center;
        font-size: 0.82rem;
        padding: 1rem 1.25rem;
        min-height: 36px;
    }

    .contact-discord-group {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .email-display {
        font-size: clamp(1.3rem, 7vw, 1.9rem);
        line-height: 1.22;
    }

    footer {
        font-size: 0.72rem;
        padding-bottom: 1.1rem;
    }

    .discord-card {
        left: 0.8rem;
        right: 0.8rem;
        bottom: 0.55rem;
        width: auto;
        max-width: none;
        padding: 0.55rem 0.65rem;
        border-radius: 12px;
    }

    .discord-card .card-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .discord-card .activity-content,
    .discord-card .card-toggle {
        display: none;
    }

    .avatar-container {
        width: 38px;
        height: 38px;
    }

    .username {
        font-size: 0.9rem;
    }

    .status-text-scroller {
        font-size: 0.7rem;
    }

    main {
        padding-bottom: 5.2rem;
    }

    .search-overlay,
    .terminal-overlay {
        padding: 0.8rem;
    }

    .search-container,
    .terminal-container {
        border-radius: 12px;
    }

    .terminal-container {
        height: min(78vh, 520px);
    }
}

@media (max-width: 420px) {
    .container {
        padding-left: max(0.9rem, env(safe-area-inset-left));
        padding-right: max(0.9rem, env(safe-area-inset-right));
    }

    .hero {
        padding-top: 6.6rem;
    }

    h1 {
        font-size: clamp(1.5rem, 8.3vw, 1.95rem);
    }

    .section-title {
        font-size: 1.38rem;
    }

    .carousel-item {
        padding: 0.78rem;
    }

    .modal-content,
    .skill-modal-content {
        width: calc(100% - 1.1rem);
        padding: 0.78rem;
        padding-top: 1.65rem;
    }

    .close-modal {
        top: 0.28rem;
        right: 0.28rem;
        font-size: 1.35rem;
    }

    input,
    textarea,
    select {
        font-size: 16px !important;
    }

    .discord-card {
        bottom: 1.5rem;
        left: auto;
        right: 1.5rem;
        width: 12px;
        height: 12px;
        padding: 0;
        border-radius: 50%;
        overflow: hidden;
        cursor: pointer;
        background: var(--violet);
        border-color: transparent;
        box-shadow: 0 0 8px var(--glow);
        transition: all 0.3s var(--ease-smooth);
    }

    .discord-card.expanded-mobile {
        width: min(320px, calc(100vw - 2rem));
        height: auto;
        padding: var(--space-3);
        border-radius: var(--radius-lg);
        border-color: rgba(189, 0, 255, 0.2);
        background: rgba(10, 5, 20, 0.92);
    }

    .discord-card > *:not(.card-toggle) {
        opacity: 0;
        pointer-events: none;
    }

    .discord-card.expanded-mobile > * {
        opacity: 1;
        pointer-events: auto;
    }

    .booking-section,
    .booking-section * {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* ----------------
 * Mobile Polish Layer
 * ---------------- */
@media (max-width: 900px) {
    .search-overlay {
        align-items: flex-start;
        padding-top: clamp(0.8rem, 6dvh, 2.5rem);
    }

    .search-container {
        width: 100%;
        max-width: none;
    }

    .terminal-container {
        width: 100%;
        max-width: none;
        height: min(84dvh, 640px);
    }

    .terminal-output {
        padding: 1rem;
        font-size: 0.88rem;
        line-height: 1.5;
    }

    .terminal-input-row {
        padding: 0.8rem 1rem;
    }

    #terminal-input {
        font-size: 0.88rem;
    }

    .gh-stats-grid {
        grid-template-columns: 1fr;
        grid-row-gap: 1rem;
        margin-bottom: 1.3rem;
    }

    .gh-stat-value {
        font-size: 1.45rem;
    }

    .donation-row {
        margin-top: 2rem;
        gap: 0.8rem;
    }

    .donation-row .btn {
        width: 100%;
        max-width: 320px;
    }

    .footer-spacing {
        margin-top: 2.5rem;
    }
}

@media (hover: none) {
    .glass-panel[data-tilt],
    .card-3d[data-tilt] {
        transform: none !important;
        transition: none !important;
    }
}

@media (max-width: 768px) {
    .search-header {
        padding: 0.9rem 1rem;
        gap: 0.7rem;
    }

    .search-header input {
        font-size: 1rem;
        min-width: 0;
    }

    .search-kbd {
        display: none;
    }

    .search-results {
        max-height: min(58dvh, 420px);
        padding: 0.4rem;
    }

    .search-item {
        padding: 0.75rem;
        gap: 0.7rem;
    }

    .search-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
        flex: 0 0 auto;
    }

    .search-info strong {
        font-size: 0.9rem;
        line-height: 1.35;
    }

    .search-info span {
        font-size: 0.74rem;
        line-height: 1.35;
    }

    .project-meta {
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-bottom: 0.9rem;
    }

    .project-quality-badge {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .modal-action-space .btn,
    .modal-description .btn {
        width: 100%;
    }

    .form-feedback {
        font-size: 0.8rem;
    }

    .modal-overlay.open .modal-content,
    #project-modal.open .modal-content,
    #skill-modal.open .modal-content {
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 16px 16px 0 0;
        margin: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        overflow-y: auto;
    }

    .close-modal {
        position: sticky;
        top: 0.75rem;
        z-index: 10;
    }
}

@media (max-width: 600px) {
    .logo img {
        height: 34px !important;
    }

    .nav-right {
        gap: 0.45rem;
    }

    .perf-btn {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .lang-btn {
        font-size: 0.64rem;
        padding: 0.2rem 0.42rem;
    }

    .hero-tag {
        width: auto;
        max-width: calc(100% - 1rem);
        justify-content: center;
        text-align: center;
        padding: 0.52rem 0.7rem;
        border-radius: 14px;
        font-size: 0.74rem;
        margin-right: 0;
        white-space: nowrap;
        line-height: 1.2;
    }

    .live-visitors {
        width: auto;
        max-width: calc(100% - 1rem);
        justify-content: center;
        text-align: center;
        border-radius: 14px;
        font-size: 0.72rem;
        padding: 0.5rem 0.7rem;
        margin-left: 0.4rem;
        white-space: nowrap;
        line-height: 1.2;
    }

    #live-visitors-text {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: min(58vw, 220px);
    }

    .modal-content,
    .skill-modal-content {
        width: calc(100% - 0.9rem);
        max-height: min(86dvh, 700px);
    }

    .terminal-header {
        padding: 0.8rem 1rem;
    }

    .terminal-title {
        font-size: 0.72rem;
        letter-spacing: 0.04em;
    }

    .terminal-input-row {
        padding: 0.65rem 0.85rem;
    }

    .contact-link {
        min-height: 40px;
    }

    .discord-card {
        bottom: calc(0.55rem + env(safe-area-inset-bottom));
    }

    main {
        padding-bottom: calc(5.8rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 420px) {
    .search-container::after {
        display: none;
    }

    .search-results {
        max-height: min(55dvh, 360px);
    }

    .hero-sub,
    .hero p {
        font-size: 0.88rem;
    }

    .hero-tag {
        font-size: 0.7rem;
        padding: 0.46rem 0.62rem;
    }

    .live-visitors {
        font-size: 0.68rem;
        padding: 0.46rem 0.62rem;
        margin-left: 0.32rem;
    }

    #live-visitors-text {
        max-width: min(54vw, 180px);
    }

    .tech-pill {
        font-size: 0.64rem;
        padding: 0.22rem 0.4rem;
    }

    .gh-stat-value {
        font-size: 1.25rem;
    }

    .gh-stat-label {
        font-size: 0.68rem;
    }
}

/* ----------------
 * Booking Modal Styles
 * ---------------- */
.booking-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.booking-modal-overlay.open {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.booking-modal-dialog {
    background: rgba(20, 10, 30, 0.95);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    width: min(94vw, 680px);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    box-shadow: 0 0 24px rgba(189, 0, 255, 0.18);
}

.booking-modal-overlay.open .booking-modal-dialog {
    transform: scale(1);
}

.booking-close-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    z-index: 10;
    padding: 0.2rem;
}

.booking-close-btn:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.booking-modal-content {
    padding: var(--space-5);
}

.booking-modal-head {
    margin-bottom: var(--space-6);
    padding-right: var(--space-6);
}

.booking-modal-head h2 {
    margin: 0;
    color: #fff;
    font-size: 1.3rem;
    text-shadow: 0 0 20px rgba(189, 0, 255, 0.3);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.booking-modal-head p {
    margin: 0;
    color: rgba(233, 228, 245, 0.85);
    font-size: 0.9rem;
}

.booking-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.booking-form-columns {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.booking-form-left,
.booking-form-right {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

@media (min-width: 980px) {
    .booking-modal-dialog {
        width: min(94vw, 960px);
    }

    .booking-form-columns {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
        column-gap: var(--space-5);
        align-items: start;
    }

    .booking-form-left {
        grid-column: 1;
    }

    .booking-form-right {
        grid-column: 2;
    }
}

.booking-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.section-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(167, 139, 250, 0.95);
    font-family: var(--font-mono);
    margin-bottom: var(--space-2);
}

.booking-availability-slots {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.booking-slot-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(167, 139, 250, 0.34);
    background: rgba(124, 58, 237, 0.15);
    color: #ddd6fe;
    font-size: 0.74rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all var(--transition-base);
}

.booking-slot-pill:hover {
    border-color: rgba(167, 139, 250, 0.6);
    background: rgba(124, 58, 237, 0.25);
}

.booking-form select {
    width: 100%;
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    font-size: var(--text-base);
    transition: all var(--transition-base);
    outline: none;
    appearance: none;
    cursor: pointer;
    padding-right: var(--space-4);
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right var(--space-2) center;
    background-size: 1.2em;
}

.booking-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(189, 0, 255, 0.2);
}

.booking-form select option {
    background: rgba(20, 10, 30, 0.95);
    color: #fff;
}

.booking-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.btn-booking-toggle {
    width: 100%;
    justify-content: center;
    gap: var(--space-2);
}

@media (max-width: 600px) {
    .booking-modal-dialog {
        width: min(96vw, 640px);
    }

    .booking-modal-content {
        padding: var(--space-4);
        padding-top: 1.9rem;
    }

    .booking-modal-head h2 {
        font-size: 1.12rem;
    }

    .booking-close-btn {
        top: 0.35rem;
        right: 0.35rem;
        font-size: 1.5rem;
    }

    .booking-form-actions {
        grid-template-columns: 1fr;
    }
}

/* Booking Form Group Styles */
#booking-form .form-group {
    position: relative;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

#booking-form .form-group {
    margin-bottom: 0;
}

#booking-form .form-group input:not([type="radio"]):not([type="checkbox"]),
#booking-form .form-group textarea,
#booking-form .form-group select {
    width: 100%;
    padding: var(--space-3) var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    font-size: var(--text-base);
    transition: all var(--transition-base);
    outline: none;
}

#booking-form .form-group input:not([type="radio"]):not([type="checkbox"])::placeholder,
#booking-form .form-group textarea::placeholder {
    color: transparent;
}

#booking-form .form-group label {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    font-size: var(--text-base);
    color: rgba(233, 228, 245, 0.7);
    pointer-events: none;
    transition: all 0.2s ease;
    line-height: 1.5;
    transform-origin: left top;
}

#booking-form .form-group input:not([type="radio"]):not([type="checkbox"]):focus,
#booking-form .form-group textarea:focus,
#booking-form .form-group select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(189, 0, 255, 0.15);
}

#booking-form .form-group input:not([type="radio"]):not([type="checkbox"]):not(:placeholder-shown) ~ label,
#booking-form .form-group input:not([type="radio"]):not([type="checkbox"]):focus ~ label,
#booking-form .form-group textarea:not(:placeholder-shown) ~ label,
#booking-form .form-group textarea:focus ~ label,
#booking-form .form-group select:required:not([value=""]) ~ label,
#booking-form .form-group select:focus ~ label {
    top: -0.5rem;
    left: var(--space-2);
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(20, 10, 30, 0.95);
    padding: 0 var(--space-1);
    transform: translateY(0);
}

#booking-form .form-group textarea {
    resize: vertical;
    min-height: 100px;
    padding: var(--space-3);
}

.form-feedback {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: none;
    margin-top: var(--space-3);
    border-left: 3px solid;
    animation: slideIn 0.3s ease;
}

.form-feedback.success {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border-left-color: #22c55e;
}

.form-feedback.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-left-color: #ef4444;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================
   Custom Date & Time Picker Styles
   ===================================== */

.datetime-picker {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    margin: var(--space-4) 0;
}

.date-picker-wrapper,
.time-picker-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.picker-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(167, 139, 250, 0.95);
    font-family: var(--font-mono);
    display: block;
}

/* ===== CALENDAR STYLES ===== */
.calendar-container {
    background: linear-gradient(135deg, rgba(20, 10, 30, 0.95), rgba(15, 8, 25, 0.98));
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    gap: var(--space-3);
}

.calendar-month-year {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    text-align: center;
    flex: 1;
}

.calendar-month {
    font-size: 1rem;
    color: #fff;
    text-transform: capitalize;
    font-weight: 500;
}

.calendar-year {
    font-size: 0.75rem;
    color: rgba(167, 139, 250, 0.8);
}

.calendar-nav {
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius-md);
    color: #ddd6fe;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-nav:hover {
    background: rgba(124, 58, 237, 0.25);
    border-color: rgba(124, 58, 237, 0.5);
    transform: scale(1.05);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.weekday {
    text-align: center;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(167, 139, 250, 0.7);
    font-family: var(--font-mono);
    font-weight: 500;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-2);
}

.calendar-day {
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: #ddd6fe;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.calendar-day:not(.disabled):hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.5);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.calendar-day.empty {
    pointer-events: none;
    background: transparent;
    border: none;
}

.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
    border-color: rgba(124, 58, 237, 0.1);
}

.calendar-day.selected {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(167, 139, 250, 0.3));
    border-color: rgba(167, 139, 250, 0.8);
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.4), inset 0 0 8px rgba(167, 139, 250, 0.2);
    color: #f0abfc;
}

/* ===== TIME PICKER STYLES ===== */
.time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: var(--space-2);
    padding: var(--space-4);
    background: linear-gradient(135deg, rgba(20, 10, 30, 0.95), rgba(15, 8, 25, 0.98));
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    min-height: 120px;
}

.time-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(167, 139, 250, 0.5);
    font-size: 0.9rem;
    padding: var(--space-4);
}

.time-slot {
    padding: var(--space-3);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: #ddd6fe;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.5);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.time-slot.selected {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(167, 139, 250, 0.3));
    border-color: rgba(167, 139, 250, 0.8);
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.4), inset 0 0 8px rgba(167, 139, 250, 0.2);
    color: #f0abfc;
    transform: scale(1.05);
}

/* ===== SELECTION DISPLAY ===== */
.selected-datetime-display {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.08), rgba(167, 139, 250, 0.04));
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-md);
    margin-top: var(--space-2);
}

.selected-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
}

.selected-item i {
    color: rgba(167, 139, 250, 0.8);
    font-size: 1.1rem;
}

.datetime-value {
    color: #ddd6fe;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .calendar-days {
        gap: var(--space-1);
    }

    .calendar-day {
        font-size: 0.75rem;
    }

    .time-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-1);
        padding: var(--space-3);
    }

    .time-slot {
        padding: var(--space-2);
        font-size: 0.8rem;
    }
}

/* ----------------
 * Search Input Focus
 * ---------------- */
#projects-search:focus,
.project-search-input:focus,
.search-input:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

/* ── BACK TO TOP ── */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--violet-light);
    font-size: 1rem;
    backdrop-filter: var(--glass-blur);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 998;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-2px);
    border-color: var(--violet);
    box-shadow: var(--glow-hover);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 4rem;
        right: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: opacity 0.3s;
    }
}