/*
* ============================================================
*  ENHANCE.CSS — Design polish layer
*  Loaded last. Refines and harmonises the dark glassmorphism
*  theme: fixes light-theme bleed-through, elevates the hero,
*  navbar, cards, forms and micro-interactions.
* ============================================================
*/

/* ------------------------------------------------------------
 * GSAP animation layer (js/gsap-animations.js)
 * ---------------------------------------------------------- */

/* SplitText words/chars need inline-block to be transform-able */
.gsap-word, .gsap-char { display: inline-block; }

/* Growing line drawn behind the experience timeline on scroll */
.timeline-progress {
    position: absolute;
    width: 3px;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
    background: linear-gradient(180deg, #bc13fe, #00f3ff);
    border-radius: 3px;
    transform-origin: top center;
    transform: scaleY(0);
    z-index: 1;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(188, 19, 254, 0.5);
}
@media (max-width: 991px) {
    .timeline-progress { left: 40px; margin-left: 0; }
}

/* Reading progress bar pinned above the navbar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1031;
    background: transparent;
    pointer-events: none;
}
.scroll-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #bc13fe, #00f3ff);
    box-shadow: 0 0 10px rgba(188, 19, 254, 0.6);
    transform-origin: left center;
}

/* Infinite marquee strip of keywords below the hero */
.hero-marquee {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 0;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.hero-marquee-track {
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    will-change: transform;
}
.hero-marquee-item {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary, #b0b0cc);
    white-space: nowrap;
}
.hero-marquee-dot {
    color: #bc13fe;
    font-size: 0.6rem;
}
:root[data-theme="light"] .hero-marquee {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}
:root[data-theme="light"] .hero-marquee-item { color: #4a4a68; }

:root {
    /* Extra design tokens layered on top of the neon palette */
    --e-radius: 18px;
    --e-radius-lg: 24px;
    --e-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --e-surface: rgba(255, 255, 255, 0.04);
    --e-surface-strong: rgba(255, 255, 255, 0.06);
    --e-border: rgba(255, 255, 255, 0.10);
    --e-border-hover: rgba(188, 19, 254, 0.45);
    --e-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
    --e-glow-violet: 0 0 24px rgba(188, 19, 254, 0.35);
    --e-glow-cyan: 0 0 24px rgba(0, 243, 255, 0.30);
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    :root { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* Smoother base rendering */
body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------
 * Custom scrollbar
 * ---------------------------------------------------------- */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(188, 19, 254, 0.5) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6e00ff, #bc13fe);
    border-radius: 10px;
    border: 2px solid var(--bg-dark, #0a0a0f);
}
::-webkit-scrollbar-thumb:hover { background: #bc13fe; }

/* ------------------------------------------------------------
 * Scroll progress bar (top of viewport)
 * ---------------------------------------------------------- */
#scrollProgress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    z-index: 2000;
    background: linear-gradient(90deg, #6e00ff, #bc13fe, #00f3ff);
    box-shadow: 0 0 12px rgba(188, 19, 254, 0.6);
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ------------------------------------------------------------
 * Preloader — no more white flash
 * ---------------------------------------------------------- */
#preloader {
    background-color: #0a0a0f !important;
    background-image:
        radial-gradient(circle at 30% 30%, rgba(110, 0, 255, 0.18), transparent 45%),
        radial-gradient(circle at 70% 70%, rgba(188, 19, 254, 0.14), transparent 45%);
}
#preloader .loader {
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: #bc13fe;
    border-right-color: #00f3ff;
    box-shadow: 0 0 30px rgba(188, 19, 254, 0.4);
    width: 46px;
    height: 46px;
}

/* ------------------------------------------------------------
 * Navbar — real glass + refined sticky state
 * ---------------------------------------------------------- */
.navbar {
    background: transparent;
    transition: background 0.4s var(--e-ease), padding 0.4s var(--e-ease),
                box-shadow 0.4s var(--e-ease), border-color 0.4s var(--e-ease);
    border-bottom: 1px solid transparent;
}
.navbar.navbar-sticky {
    background: rgba(10, 10, 15, 0.72) !important;
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 10px 40px -18px rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 0;
}

/* Animated underline for nav links (desktop) */
@media (min-width: 992px) {
    .navbar .nav-link {
        position: relative;
        padding: 8px 4px !important;
        margin: 0 10px;
    }
    .navbar .nav-link::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        height: 2px;
        width: 0;
        border-radius: 2px;
        background: linear-gradient(90deg, #bc13fe, #00f3ff);
        box-shadow: 0 0 8px rgba(188, 19, 254, 0.6);
        transition: width 0.35s var(--e-ease);
    }
    .navbar .nav-link:hover::after,
    .navbar .nav-link.active::after { width: 100%; }
}

/* ------------------------------------------------------------
 * Theme toggle button (light/dark)
 * ---------------------------------------------------------- */
.nav-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--e-border);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.3s var(--e-ease), background 0.3s var(--e-ease),
                box-shadow 0.3s var(--e-ease), color 0.3s var(--e-ease);
}
.theme-toggle:hover {
    transform: translateY(-2px) rotate(-15deg);
    box-shadow: var(--e-glow-violet);
    border-color: var(--e-border-hover);
}
.theme-toggle i { transition: transform 0.4s var(--e-ease); }

/* Make toggle + hamburger clearly visible over ANY background (incl. top of
   page where the navbar is transparent), and keep them inside the viewport. */
.nav-right { flex-shrink: 0; }
.theme-toggle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
/* Hamburger bars: light in dark theme (base CSS made them dark violet) */
.navbar-toggler .navbar-toggler-icon,
.navbar-toggler .navbar-toggler-icon::before,
.navbar-toggler .navbar-toggler-icon::after { background-color: #ffffff; }
@media (max-width: 991px) {
    .navbar > .container { padding-left: 16px; padding-right: 16px; }
    .nav-right { gap: 8px; }
    .theme-toggle { width: 40px; height: 40px; font-size: 0.95rem; }
}

/* Contact items: consistent, left-aligned rows on mobile (was messy centring) */
@media (max-width: 767px) {
    .contact-item {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 14px;
        margin-bottom: 22px;
    }
    .contact-item .icon { margin: 0; flex-shrink: 0; }
    .contact-item .content h4,
    .contact-item .content p { text-align: left; }
    .social-links { justify-content: flex-start; }
}

/* ------------------------------------------------------------
 * Section titles — readable subtitle + eyebrow feel
 * ---------------------------------------------------------- */
.section-title { margin-bottom: 64px; }
.section-title h2 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    letter-spacing: -0.02em;
}
.section-title p {
    color: #00f3ff !important;
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 10px;
}

/* ------------------------------------------------------------
 * Hero — animated aurora background + polish
 * ---------------------------------------------------------- */
.hero-section::before,
.hero-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
}
.hero-section::before {
    width: 40vw;
    height: 40vw;
    max-width: 520px;
    max-height: 520px;
    top: -8%;
    left: -6%;
    background: radial-gradient(circle, rgba(110, 0, 255, 0.55), transparent 70%);
    animation: heroFloat1 14s ease-in-out infinite;
}
.hero-section::after {
    width: 36vw;
    height: 36vw;
    max-width: 480px;
    max-height: 480px;
    bottom: -10%;
    right: -4%;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.30), transparent 70%);
    animation: heroFloat2 18s ease-in-out infinite;
}
.hero-section .container { position: relative; z-index: 1; }

@keyframes heroFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 40px) scale(1.1); }
}
@keyframes heroFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, -30px) scale(1.15); }
}

.hero-content .title {
    line-height: 1.05;
    font-size: clamp(2.6rem, 7vw, 4.4rem);
}
.hero-content .typed-text {
    color: #c9c9ff;
    font-weight: 500;
}
.typed-cursor { color: #00f3ff !important; }

.hero-image {
    border-radius: var(--e-radius-lg);
    transition: transform 0.6s var(--e-ease);
}
.hero-image:hover { transform: translateY(-6px); }

/* Scroll-down indicator on dark bg */
.scroll-down a {
    background: rgba(255, 255, 255, 0.06);
    color: #00f3ff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(188, 19, 254, 0.25);
}

/* ------------------------------------------------------------
 * Buttons — refined, uniform
 * ---------------------------------------------------------- */
.btn {
    letter-spacing: 0.5px;
    padding: 12px 30px;
    transition: transform 0.3s var(--e-ease), box-shadow 0.3s var(--e-ease),
                background 0.3s var(--e-ease), color 0.3s var(--e-ease);
}
.btn-primary:active,
.btn-outline:active { transform: translateY(-1px); }

/* ------------------------------------------------------------
 * Cards — richer hover + image framing
 * ---------------------------------------------------------- */
.portfolio-wrap,
.blog-card,
.passion-card,
.education-item,
.timeline-content,
.contact-info {
    border-radius: var(--e-radius-lg) !important;
}
.portfolio-wrap img,
.blog-img img,
.passion-img img { filter: saturate(1.02); }

/* Category chip harmonised with neon */
.portfolio-category {
    color: #00f3ff !important;
    background: rgba(0, 243, 255, 0.08);
    padding: 4px 12px;
    border-radius: 50px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

/* Education / passion accents */
.education-content .period,
.passion-content .passion-category { color: #00f3ff !important; }
.education-content .location,
.timeline-content .location { color: var(--text-secondary, #b0b0cc) !important; opacity: 0.8; }

/* Company + education logos: keep readable on dark cards */
.education-icon img,
.company-logo img {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 10px;
    padding: 6px;
}

/* ------------------------------------------------------------
 * Timeline — glass arrows, gradient spine, glowing nodes
 * ---------------------------------------------------------- */
.timeline::before {
    background: linear-gradient(180deg, transparent, rgba(188, 19, 254, 0.5) 12%,
                rgba(0, 243, 255, 0.5) 88%, transparent) !important;
    width: 2px !important;
}
.timeline-item::before {
    background: #bc13fe !important;
    border: 4px solid #12121a !important;
    box-shadow: 0 0 0 2px rgba(188, 19, 254, 0.4), 0 0 16px rgba(188, 19, 254, 0.7) !important;
}
.timeline-item.left .timeline-content::after {
    border-left-color: rgba(255, 255, 255, 0.05) !important;
}
.timeline-item.right .timeline-content::after {
    border-right-color: rgba(255, 255, 255, 0.05) !important;
}
@media (max-width: 991px) {
    .timeline-item.left .timeline-content::after,
    .timeline-item.right .timeline-content::after {
        border-right-color: rgba(255, 255, 255, 0.05) !important;
        border-left-color: transparent !important;
    }
}

/* ------------------------------------------------------------
 * Contact form — was a white box, now glass
 * ---------------------------------------------------------- */
.contact-form {
    background: var(--e-surface) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--e-border);
    border-radius: var(--e-radius-lg);
    box-shadow: var(--e-shadow);
}
.contact-form .form-control {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--e-border);
    color: #ffffff;
    border-radius: 12px;
}
.contact-form .form-control::placeholder { color: rgba(255, 255, 255, 0.4); }
.contact-form .form-control:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--e-border-hover);
    box-shadow: 0 0 0 3px rgba(188, 19, 254, 0.15);
    color: #fff;
}
.contact-info { border-radius: var(--e-radius-lg); }
.contact-item .content h4 { color: #fff; }
.contact-item .content p { color: var(--text-secondary, #b0b0cc); }

/* ------------------------------------------------------------
 * Footer — was bright indigo (secondary redefined), now dark glass
 * ---------------------------------------------------------- */
.footer-section {
    background: #08080d !important;
    background-image:
        radial-gradient(circle at 15% 0%, rgba(110, 0, 255, 0.14), transparent 45%),
        radial-gradient(circle at 85% 100%, rgba(0, 243, 255, 0.08), transparent 45%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer-info h3 {
    background: linear-gradient(45deg, #fff, #bc13fe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.footer-links ul li a:hover { color: #00f3ff; }
.footer-newsletter input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-newsletter input::placeholder { color: rgba(255, 255, 255, 0.4); }
.footer-newsletter button {
    background: linear-gradient(135deg, #6e00ff, #bc13fe);
}
.footer-newsletter button:hover { background: linear-gradient(135deg, #bc13fe, #6e00ff); }

/* ------------------------------------------------------------
 * Back-to-top — neon glass
 * ---------------------------------------------------------- */
.back-to-top {
    background: linear-gradient(135deg, #6e00ff, #bc13fe);
    box-shadow: 0 6px 20px rgba(110, 0, 255, 0.45);
    width: 44px;
    height: 44px;
}
.back-to-top:hover {
    background: linear-gradient(135deg, #bc13fe, #00f3ff);
    transform: translateY(-4px);
}

/* ------------------------------------------------------------
 * Accessibility — visible keyboard focus
 * ---------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.nav-link:focus-visible,
.portfolio-filter li:focus-visible,
.blog-filter li:focus-visible {
    outline: 2px solid #00f3ff;
    outline-offset: 3px;
    border-radius: 6px;
}

/* Dark-mode cards: a subtle violet sheen so surfaces feel less neutral */
:root[data-theme="dark"] .portfolio-wrap,
:root[data-theme="dark"] .blog-card,
:root[data-theme="dark"] .passion-card,
:root[data-theme="dark"] .education-item,
:root[data-theme="dark"] .timeline-content,
:root[data-theme="dark"] .contact-info,
:root[data-theme="dark"] .related-project-card,
:root[data-theme="dark"] .stat-tile {
    background: linear-gradient(180deg, rgba(188, 19, 254, 0.08), rgba(255, 255, 255, 0.035)) !important;
}
:root[data-theme="dark"] .portfolio-wrap:hover,
:root[data-theme="dark"] .blog-card:hover,
:root[data-theme="dark"] .passion-card:hover,
:root[data-theme="dark"] .education-item:hover,
:root[data-theme="dark"] .timeline-content:hover,
:root[data-theme="dark"] .related-project-card:hover,
:root[data-theme="dark"] .stat-tile:hover {
    background: linear-gradient(180deg, rgba(188, 19, 254, 0.14), rgba(255, 255, 255, 0.05)) !important;
}

/* ============================================================
 *  STATS / KPI BAND — data-flavoured
 * ============================================================ */
.stats-band {
    padding: 10px 0 20px;
    margin-top: -20px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.stat-tile {
    background: var(--e-surface);
    border: 1px solid var(--e-border);
    border-radius: 18px;
    padding: 22px 22px 18px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--e-shadow);
    transition: transform 0.35s var(--e-ease), border-color 0.35s var(--e-ease),
                box-shadow 0.35s var(--e-ease);
}
.stat-tile:hover {
    transform: translateY(-6px);
    border-color: var(--e-border-hover);
    box-shadow: 0 22px 44px -20px rgba(0, 0, 0, 0.7), 0 0 22px rgba(188, 19, 254, 0.18);
}
.stat-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.stat-num {
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1;
    background: linear-gradient(120deg, #ffffff, #bc13fe 70%, #00f3ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-num .kpi-suffix { -webkit-text-fill-color: #00f3ff; }
.stat-spark, .stat-bars { width: 74px; height: 30px; opacity: 0.9; }
.stat-spark polyline {
    fill: none;
    stroke: #bc13fe;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(188, 19, 254, 0.6));
    stroke-dasharray: 240;
    stroke-dashoffset: 240;
}
.stat-tile.is-live .stat-spark polyline {
    animation: sparkDraw 1.4s var(--e-ease) forwards;
}
@keyframes sparkDraw { to { stroke-dashoffset: 0; } }
.stat-bars rect {
    fill: #8b2fd6;
    transform-origin: bottom;
    transform: scaleY(0);
}
.stat-bars rect:last-child { fill: #00f3ff; }
.stat-tile.is-live .stat-bars rect { animation: barGrow 0.9s var(--e-ease) forwards; }
.stat-tile.is-live .stat-bars rect:nth-child(2) { animation-delay: 0.1s; }
.stat-tile.is-live .stat-bars rect:nth-child(3) { animation-delay: 0.2s; }
.stat-tile.is-live .stat-bars rect:nth-child(4) { animation-delay: 0.3s; }
@keyframes barGrow { to { transform: scaleY(1); } }
.stat-label {
    color: var(--text-secondary, #b0b0cc);
    font-size: 0.9rem;
    line-height: 1.4;
}
:root[data-theme="light"] .stat-label { color: #4a4a68; }
:root[data-theme="light"] .stat-num {
    background: linear-gradient(120deg, #1a1a2e, #6e00ff 70%, #0a8fa3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
:root[data-theme="light"] .stat-num .kpi-suffix { -webkit-text-fill-color: #0a8fa3; }
@media (max-width: 767px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-tile { padding: 16px 16px 14px; border-radius: 16px; }
    .stat-spark, .stat-bars { width: 56px; height: 26px; }
}

/* ============================================================
 *  MOBILE READABILITY — Hero (Accueil) & Portfolio (Projets)
 * ============================================================ */

/* --- Portfolio carousel counter: readable on dark theme --- */
.portfolio-counter {
    color: var(--text-secondary, #b0b0cc) !important;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--e-border);
    border-radius: 50px;
    padding: 4px 16px;
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
}
.portfolio-counter .current-page,
.portfolio-counter .total-pages { color: #00f3ff !important; }

/* Hide unused/empty indicator dots so controls don't look broken */
.portfolio-indicators:empty { display: none; }

/* Neon carousel controls, both original and injected rows */
.portfolio-carousel-controls,
.portfolio-section .carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.portfolio-prev, .portfolio-next,
.portfolio-section .carousel-prev,
.portfolio-section .carousel-next {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--e-border);
    color: #fff;
    transition: transform 0.25s var(--e-ease), background 0.25s var(--e-ease),
                box-shadow 0.25s var(--e-ease);
}
.portfolio-prev:hover, .portfolio-next:hover,
.portfolio-section .carousel-prev:hover,
.portfolio-section .carousel-next:hover {
    background: linear-gradient(135deg, #6e00ff, #bc13fe);
    box-shadow: var(--e-glow-violet);
    transform: translateY(-2px);
}

/* --- Portfolio cards: clearer typography & tap targets --- */
.portfolio-info h4 {
    color: #fff !important;
    font-size: 1.05rem;
    line-height: 1.35;
}
.portfolio-info p {
    color: var(--text-secondary, #b0b0cc) !important;
    line-height: 1.6;
}
.portfolio-links .details-link {
    background: linear-gradient(135deg, #6e00ff, #bc13fe);
    border: none;
    padding: 9px 18px;
    font-size: 0.85rem;
}
.portfolio-links .details-link:hover {
    background: linear-gradient(135deg, #bc13fe, #00f3ff);
    color: #fff;
    box-shadow: var(--e-glow-violet);
}

/* Tablet & phone: bigger controls for touch */
@media (max-width: 991px) {
    .portfolio-prev, .portfolio-next,
    .portfolio-section .carousel-prev,
    .portfolio-section .carousel-next {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
}

@media (max-width: 767px) {
    /* Hero: tighten spacing so text-only layout isn't sparse */
    .hero-section {
        min-height: auto;
        padding: 110px 0 70px;
        text-align: center;
    }
    .hero-content { animation: none; }
    .hero-content .subtitle {
        letter-spacing: 2px;
        margin-bottom: 12px;
    }
    .hero-content .title {
        /* Solid fallback keeps the name legible over the aurora glow */
        -webkit-text-fill-color: #ffffff;
        background: none;
        filter: none;
        line-height: 1.12;
    }
    .hero-content .skills {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-bottom: 26px;
    }
    .hero-content .skill-tag { margin: 0; }
    .hero-btn { max-width: 320px; margin-left: auto; margin-right: auto; }

    /* Portfolio: card takes full width but stays comfortably readable */
    .portfolio-item { padding-left: 8px; padding-right: 8px; }
    .portfolio-img { height: 200px; }
    .portfolio-info { padding: 18px 18px 20px; }
    .portfolio-info h4 { font-size: 1.1rem; }
    .portfolio-info p {
        -webkit-line-clamp: 3;
        height: auto;
        max-height: 4.8em;
        font-size: 0.92rem;
    }
    .portfolio-links { text-align: center; margin-top: 4px; }
    .portfolio-links .details-link {
        width: 100%;
        padding: 11px 18px;
        font-size: 0.9rem;
    }
    /* Section eyebrow slightly smaller on phones */
    .section-title p { letter-spacing: 2px; font-size: 0.78rem; }
}

@media (max-width: 480px) {
    .hero-section { padding: 100px 0 60px; }
    .hero-content .subtitle { font-size: 13px; }
    /* Single, centred, comfortably wide card on small phones */
    .portfolio-container .portfolio-item {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
        float: none;
    }
    .portfolio-img { height: 190px; }
}

/* ============================================================
 *  CHATBOT — polish & liveliness
 * ============================================================ */
.chat-popup {
    border-radius: 20px !important;
    /* Fond plus contrasté : sombre et opaque pour faire ressortir le texte */
    background: #14141f !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.85), 0 0 30px rgba(188, 19, 254, 0.18) !important;
    overflow: hidden;
}
.chat-popup-body {
    background: #0d0d15;
    color: #eef0f8;
}
.chat-popup-footer {
    background: #14141f;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.chat-popup-footer input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
}
/* Bulles plus lisibles */
.bulle-joris {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #fff !important;
}
.bulle-utilisateur {
    background: linear-gradient(135deg, #6e00ff, #bc13fe) !important;
    color: #fff !important;
}
.chat-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
/* "En ligne" indicator before the title */
.chat-popup-header span:first-child { position: relative; padding-left: 16px; }
.chat-popup-header span:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2bff88;
    box-shadow: 0 0 8px #2bff88;
    animation: chatOnlinePulse 2s ease-in-out infinite;
}
@keyframes chatOnlinePulse {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.5; transform: translateY(-50%) scale(0.8); }
}
.close-chat {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.close-chat:hover { opacity: 1; transform: rotate(90deg); }

/* Message entrance animation */
.bulle-joris, .bulle-utilisateur {
    animation: chatMsgIn 0.35s var(--e-ease);
}
@keyframes chatMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Avatar ring in Joris' bubbles */
.content-wrapper img {
    border: 2px solid rgba(188, 19, 254, 0.6);
    box-shadow: 0 0 10px rgba(188, 19, 254, 0.4);
}

/* Keep chat text readable whatever the page theme (popup stays dark) */
.chat-popup-body { color: #e6e6f5; }
.chat-popup-body > p { color: #e6e6f5; }

/* Formatted bot answers: readable paragraphs & lists */
.bot-message-text p { margin: 0 0 8px; line-height: 1.55; }
.bot-message-text p:last-child { margin-bottom: 0; }
.bot-message-text ul { margin: 6px 0 8px; padding-left: 18px; }
.bot-message-text li { margin-bottom: 4px; line-height: 1.5; }
.bot-message-text strong { color: #fff; }

/* Suggestion chips themed for dark glass */
.preset-phrases button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d5d5e8;
}
.preset-phrases button:hover {
    background: rgba(188, 19, 254, 0.18);
    border-color: rgba(188, 19, 254, 0.5);
    color: #fff;
}

/* Bubble attention pulse uses the neon glow */
.chatbot-bubble {
    box-shadow: 0 6px 20px rgba(110, 0, 255, 0.5), 0 0 0 0 rgba(188, 19, 254, 0.5);
}

/* ============================================================
 *  VIDEO EMBEDS (intro video + video links in projects/articles)
 * ============================================================ */
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--e-border);
    box-shadow: var(--e-shadow);
    background: #000;
    margin: 1.6em 0;
}
.video-embed iframe,
.video-embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.intro-video-section { padding-top: 40px; }
.intro-video-section .video-embed { margin: 0; }
:root[data-theme="light"] .video-embed {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 16px 40px -20px rgba(110, 0, 255, 0.28);
}

/* ============================================================
 *  NO HORIZONTAL OVERFLOW (fixes the "screen too wide / scroll
 *  sideways" issue and keeps the top-right toggle on screen)
 * ============================================================ */
html, body { overflow-x: hidden; max-width: 100%; }
img, svg, video, iframe { max-width: 100%; }
.portfolio-carousel, .blog-carousel,
.portfolio-container, .blog-container { max-width: 100%; overflow: hidden; }

/* ============================================================
 *  HARMONISE PROJECTS & ARTICLES
 * ============================================================ */
/* Category chip on blog cards, identical to project cards */
.blog-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #00f3ff !important;
    background: rgba(0, 243, 255, 0.08);
    padding: 4px 12px;
    border-radius: 50px;
    border: 1px solid rgba(0, 243, 255, 0.2);
    margin-bottom: 12px;
}
:root[data-theme="light"] .blog-category,
:root[data-theme="light"] .portfolio-category { color: #0a8fa3 !important; background: rgba(10, 143, 163, 0.08); border-color: rgba(10, 143, 163, 0.25); }

/* "Lire l'article" becomes a gradient button like "Voir le projet" */
.read-more {
    align-self: flex-start;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 50px;
    background: linear-gradient(135deg, #6e00ff, #bc13fe) !important;
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.2px;
    text-shadow: none;
    transition: background 0.3s var(--e-ease), box-shadow 0.3s var(--e-ease), transform 0.3s var(--e-ease);
}
.read-more:hover {
    background: linear-gradient(135deg, #bc13fe, #00f3ff) !important;
    color: #fff !important;
    box-shadow: var(--e-glow-violet);
    transform: translateY(-2px);
    padding-left: 18px;
    text-shadow: none;
}
.read-more i { margin-left: 0; font-size: 0.8em; }

/* Unify carousel arrows (projects + blog) to the same neon solid circles */
.portfolio-prev, .portfolio-next,
.portfolio-section .carousel-prev, .portfolio-section .carousel-next,
.blog-section .carousel-prev, .blog-section .carousel-next,
.carousel-prev, .carousel-next {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6e00ff, #bc13fe);
    border: none;
    color: #fff;
    box-shadow: 0 6px 18px rgba(110, 0, 255, 0.4);
    transition: transform 0.25s var(--e-ease), box-shadow 0.25s var(--e-ease), background 0.25s var(--e-ease);
}
.portfolio-prev:hover, .portfolio-next:hover,
.carousel-prev:hover, .carousel-next:hover {
    background: linear-gradient(135deg, #bc13fe, #00f3ff);
    box-shadow: 0 8px 22px rgba(188, 19, 254, 0.55);
    transform: translateY(-2px);
}
.portfolio-prev.disabled, .portfolio-next.disabled,
.carousel-prev.disabled, .carousel-next.disabled {
    opacity: 0.45;
    box-shadow: none;
    transform: none;
}

/* ------------------------------------------------------------
 * Scroll reveal (progressive enhancement, JS toggles .is-visible)
 * ---------------------------------------------------------- */
.reveal-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--e-ease), transform 0.7s var(--e-ease);
    will-change: opacity, transform;
}
.reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}
