/* ============================================================
   HugoCodesNet — V4 — fun mascot, card spotlight, 3D tilt,
   click-ripple, mega section numbers, confetti.
   ============================================================ */

/* ============================================================
   1. FLOATING CARTOON MASCOT
   ============================================================ */
#mascot {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 90;
    width: 76px;
    height: 76px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition:
        transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.4s ease;
    transform: translateY(20px) scale(0.85);
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 10px 20px rgba(94, 224, 193, 0.25))
            drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}
#mascot.is-ready {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
#mascot img {
    width: 100%; height: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: mascot-bob 4s ease-in-out infinite;
}
#mascot:hover img {
    animation: mascot-wave 0.7s ease-in-out;
}
#mascot:active img { transform: scale(0.9); }

@keyframes mascot-bob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-4px) rotate(-2deg); }
}
@keyframes mascot-wave {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(-15deg) translateY(-3px); }
    50%  { transform: rotate(10deg) translateY(-3px); }
    75%  { transform: rotate(-10deg) translateY(-3px); }
    100% { transform: rotate(0deg); }
}

.mascot-bubble {
    position: absolute;
    right: calc(100% + 0.6rem);
    bottom: 50%;
    transform: translateY(50%) translateX(8px);
    background: var(--accent);
    color: #0b1322;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 0.8rem;
    border-radius: 10px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 8px 20px -6px rgba(94, 224, 193, 0.55);
}
.mascot-bubble::after {
    content: '';
    position: absolute;
    right: -5px; top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px; height: 10px;
    background: var(--accent);
    border-radius: 2px;
}
#mascot:hover .mascot-bubble {
    opacity: 1;
    transform: translateY(50%) translateX(0);
}

@media (max-width: 600px) {
    #mascot { width: 60px; height: 60px; right: 0.75rem; bottom: 0.75rem; }
    .mascot-bubble { display: none; }
}

/* ============================================================
   2. CONFETTI CANVAS
   ============================================================ */
#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 95;
}

/* ============================================================
   3. CARD SPOTLIGHT — radial glow follows cursor
   ============================================================ */
.glass,
.expertise-card,
.skill-card,
.edu-card,
.contact-card,
.stat-card,
.about-card,
.about-photo,
.timeline-card,
.code-panel-v2 {
    --spot-x: 50%;
    --spot-y: 50%;
    position: relative;
    overflow: hidden;
}
.glass::after,
.expertise-card::after,
.skill-card::after,
.edu-card::after,
.contact-card::after,
.stat-card::after,
.about-card::after,
.timeline-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(
        420px circle at var(--spot-x) var(--spot-y),
        rgba(94, 224, 193, 0.10),
        transparent 45%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
}
.glass:hover::after,
.expertise-card:hover::after,
.skill-card:hover::after,
.edu-card:hover::after,
.contact-card:hover::after,
.stat-card:hover::after,
.about-card:hover::after,
.timeline-card:hover::after {
    opacity: 1;
}
/* Keep content above the spotlight overlay */
.glass > *, .expertise-card > *, .skill-card > *, .edu-card > *,
.contact-card > *, .stat-card > *, .about-card > *, .timeline-card > * {
    position: relative;
    z-index: 1;
}

/* ============================================================
   4. HERO PHOTO 3D TILT
   ============================================================ */
.hero-v3-photo {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) !important;
    transform-style: preserve-3d;
}
/* JS sets --rx and --ry */
.hero-v3-photo.is-tilting {
    transform:
        translateY(-2px)
        perspective(1000px)
        rotateX(var(--rx, 0deg))
        rotateY(var(--ry, 0deg));
}

/* ============================================================
   5. MEGA SECTION NUMBER — slides in on scroll
   ============================================================ */
.section-header {
    position: relative;
}
.section-header .section-index {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}
.section-header.is-visible .section-index {
    transform: translateX(0);
}
.section-header::before {
    content: attr(data-num);
    position: absolute;
    top: -2.5rem; right: 0;
    font-family: var(--font-mono);
    font-size: clamp(4.5rem, 11vw, 8.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    color: rgba(94, 224, 193, 0.18);
    -webkit-text-stroke: 0;
    text-shadow: 0 0 30px rgba(94, 224, 193, 0.15);
    pointer-events: none;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition:
        opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
        transform 1s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 0;
}
.section-header.is-visible::before,
.section-header.reveal-up.is-visible::before {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.section-header > * { position: relative; z-index: 1; }

@media (max-width: 700px) {
    .section-header::before { font-size: 4rem; top: -1.5rem; }
}

/* ============================================================
   6. CLICK RIPPLE on buttons
   ============================================================ */
.btn-primary, .btn-secondary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.click-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    transform: scale(0);
    pointer-events: none;
    animation: ripple-go 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 0;
}
@keyframes ripple-go {
    to { transform: scale(4); opacity: 0; }
}
.btn-primary > *, .btn-secondary > * { position: relative; z-index: 1; }

/* ============================================================
   7. MARQUEE — speed up briefly when scrolling
   ============================================================ */
.marquee-track {
    transition: animation-duration 0.6s ease-out;
}
body.is-scrolling .marquee-track {
    animation-duration: 18s !important;
}

/* ============================================================
   8. CODE TAB — bounce icon on switch
   ============================================================ */
.code-tab-v2.is-active i {
    animation: tab-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tab-bounce {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4) rotate(-10deg); }
    100% { transform: scale(1); }
}

/* ============================================================
   9. NAV LINKS — animated underline
   ============================================================ */
.nav-links a {
    position: relative;
}
.nav-links a:not(.nav-cta)::after {
    content: '';
    position: absolute;
    left: 0.85rem; right: 0.85rem;
    bottom: 0.45rem;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:not(.nav-cta):hover::after,
.nav-links a.is-active:not(.nav-cta)::after {
    transform: scaleX(1);
}

/* ============================================================
   10. HERO HEADLINE — gradient sweep on accent word
   ============================================================ */
.hero-v3-headline .line:first-child .word-anim {
    background: linear-gradient(90deg, #fff 0%, #fff 40%, var(--accent) 50%, #fff 60%, #fff 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-sweep 6s ease-in-out infinite;
}
@keyframes gradient-sweep {
    0%, 100% { background-position: 100% 50%; }
    50%      { background-position: 0% 50%; }
}

/* ============================================================
   11. SCROLL-INDICATOR pulse upgrade
   ============================================================ */
.hero-v3-scroll {
    transition: transform 0.3s ease, color 0.3s ease;
}
.hero-v3-scroll:hover { transform: translateX(-50%) translateY(-4px); }

/* ============================================================
   12. FOOTER MEGA — iets hoger plaatsen
   ============================================================ */
.site-footer-v2 {
    padding-top: 1.25rem !important;
    margin-top: 2rem !important;
}
.footer-mega {
    margin: 0 0 1rem !important;
    line-height: 1.05 !important;
    padding-bottom: 0.35em !important; /* ruimte voor descender (g) */
    overflow: visible !important;
}

/* ============================================================
   13. MEGA SECTION-NUMBERS — subtiel maar zichtbaar
   ============================================================ */
.section-header::before {
    color: rgba(120, 235, 205, 0.30) !important;
    text-shadow:
        0 0 28px rgba(94, 224, 193, 0.25),
        0 0 60px rgba(94, 224, 193, 0.12) !important;
    font-weight: 800 !important;
}

/* ============================================================
   14. CODE RAIN — vallende code-symbolen op de achtergrond
   ============================================================ */
#code-rain {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.18;
    mix-blend-mode: screen;
}
/* zorg dat content erboven blijft */
.topnav, main, footer, .hero-v3, section { position: relative; z-index: 1; }

/* ============================================================
   15. ABOUT — persoonlijke kaart met iconen
   ============================================================ */
.about-personal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.about-personal-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: rgba(94, 224, 193, 0.06);
    border: 1px solid rgba(94, 224, 193, 0.15);
    color: var(--text-dim);
    font-size: 0.9rem;
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.about-personal-item:hover {
    transform: translateY(-3px);
    background: rgba(94, 224, 193, 0.12);
    border-color: rgba(94, 224, 193, 0.35);
    color: #fff;
}
.about-personal-item i {
    color: var(--accent);
    font-size: 1.1rem;
}

/* ============================================================
   16. AUTOMATION — artikel + fancy AI pipeline demo
   ============================================================ */
.article-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 2.5rem;
    align-items: start;
}
@media (max-width: 1000px) {
    .article-grid { grid-template-columns: 1fr; }
}

.article-body { color: var(--text-dim); line-height: 1.7; }
.article-body .article-lead {
    font-size: 1.15rem;
    color: #fff;
    line-height: 1.55;
    margin-bottom: 1.5rem;
}
.article-body h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-top: 1.6rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}
.article-body h3::before {
    content: "// ";
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 700;
}
.article-body p { margin: 0 0 1rem; }
.article-body em { color: var(--accent); font-style: normal; font-weight: 600; }

.article-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.article-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-dim);
    font-size: 0.95rem;
}
.article-list li i {
    color: var(--accent);
    font-size: 1rem;
    flex: 0 0 1.2rem;
}

.article-close {
    margin-top: 1.5rem;
    padding: 1rem 1.1rem;
    border-left: 3px solid var(--accent);
    background: rgba(94, 224, 193, 0.05);
    border-radius: 0 10px 10px 0;
    color: #fff;
    font-size: 0.98rem;
}

/* ---------------- demo frame ---------------- */
.article-demo { position: sticky; top: 6rem; }
.demo-frame {
    border-radius: 18px;
    overflow: hidden;
    background:
        radial-gradient(ellipse at top, rgba(94,224,193,0.10), transparent 60%),
        linear-gradient(180deg, rgba(15, 22, 40, 0.95), rgba(8, 12, 22, 0.95));
    border: 1px solid rgba(94, 224, 193, 0.22);
    box-shadow:
        0 20px 60px -20px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255,255,255,0.02) inset,
        0 0 80px -20px rgba(94, 224, 193, 0.25);
}
.demo-frame-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.demo-dot { width: 10px; height: 10px; border-radius: 50%; }
.demo-dot.red    { background: #ff6058; }
.demo-dot.yellow { background: #ffbd2e; }
.demo-dot.green  { background: #28c940; }
.demo-frame-title {
    margin-left: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-mute);
    letter-spacing: 0.05em;
}
.demo-live {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(94, 224, 193, 0.10);
    border: 1px solid rgba(94, 224, 193, 0.30);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.demo-live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: live-blink 1.4s ease-in-out infinite;
}
@keyframes live-blink {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.85); }
}

/* ---------------- pipeline ---------------- */
.demo-pipeline {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    align-items: stretch;
    padding: 1.5rem 1.25rem;
    min-height: 320px;
    isolation: isolate;
}
.demo-wires {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.demo-col {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.35rem;
}
.demo-col-in  { align-items: flex-start; }
.demo-col-out { align-items: flex-end;   }
.demo-col-brain {
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

/* ---------------- IN/UIT pills ---------------- */
.demo-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    background: rgba(15, 22, 40, 0.85);
    border: 1px solid rgba(94, 224, 193, 0.25);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px -4px rgba(0,0,0,0.5);
    animation: pill-pulse 6s ease-in-out infinite;
}
.demo-pill i { color: var(--accent); font-size: 0.95rem; }
@keyframes pill-pulse {
    0%, 100% { transform: translateX(0); box-shadow: 0 4px 12px -4px rgba(0,0,0,0.5); }
    50%      { transform: translateX(2px); box-shadow: 0 4px 18px -4px rgba(94,224,193,0.45); }
}
/* per-pill staggered + per-pill kleur-accent */
.demo-col-in  .demo-pill:nth-child(1) { animation-delay: 0s;    border-color: rgba(94,224,193,0.35); }
.demo-col-in  .demo-pill:nth-child(2) { animation-delay: 0.6s;  border-color: rgba(108,184,255,0.35); }
.demo-col-in  .demo-pill:nth-child(3) { animation-delay: 1.2s;  border-color: rgba(255,207,110,0.35); }
.demo-col-in  .demo-pill:nth-child(4) { animation-delay: 1.8s;  border-color: rgba(155,107,255,0.35); }
.demo-col-in  .demo-pill:nth-child(5) { animation-delay: 2.4s;  border-color: rgba(255,157,122,0.35); }

.demo-col-out .demo-pill { transform-origin: right; }
.demo-col-out .demo-pill:nth-child(1) { animation-delay: 0.4s; border-color: rgba(155,107,255,0.35); }
.demo-col-out .demo-pill:nth-child(2) { animation-delay: 1.0s; border-color: rgba(108,184,255,0.35); }
.demo-col-out .demo-pill:nth-child(3) { animation-delay: 1.6s; border-color: rgba(94,224,193,0.35);  }
.demo-col-out .demo-pill:nth-child(4) { animation-delay: 2.2s; border-color: rgba(255,207,110,0.35); }
.demo-col-out .demo-pill:nth-child(5) { animation-delay: 2.8s; border-color: rgba(255,96,88,0.35);   }

.demo-col-in i.bi-receipt,
.demo-col-out i.bi-file-earmark-pdf      { color: #5ee0c1; }
.demo-col-in i.bi-envelope,
.demo-col-out i.bi-reply                 { color: #6cb8ff; }
.demo-col-in i.bi-file-earmark-text,
.demo-col-out i.bi-archive               { color: #ffcf6e; }
.demo-col-in i.bi-person-plus,
.demo-col-out i.bi-file-earmark-richtext { color: #b794ff; }
.demo-col-in i.bi-broadcast-pin,
.demo-col-out i.bi-bell                  { color: #ff9d7a; }

/* ---------------- AI BRAIN ---------------- */
.demo-brain-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-brain-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px dashed rgba(94, 224, 193, 0.35);
    inset: 0;
}
.demo-brain-ring.r1 {
    inset: 0;
    border-style: solid;
    border-color: rgba(94, 224, 193, 0.20);
    animation: ring-pulse 3s ease-in-out infinite;
}
.demo-brain-ring.r2 {
    inset: 12px;
    animation: ring-spin 14s linear infinite;
}
.demo-brain-ring.r3 {
    inset: 26px;
    border-style: dotted;
    border-color: rgba(155, 107, 255, 0.40);
    animation: ring-spin-rev 22s linear infinite;
}
@keyframes ring-spin     { to { transform: rotate(360deg); } }
@keyframes ring-spin-rev { to { transform: rotate(-360deg); } }
@keyframes ring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(94,224,193,0.25), inset 0 0 18px rgba(94,224,193,0.12); }
    50%      { box-shadow: 0 0 0 8px rgba(94,224,193,0.00), inset 0 0 28px rgba(94,224,193,0.22); }
}

.demo-brain-orbit {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    animation: orbit-spin 8s linear infinite;
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.demo-orbit-dot {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    top: -4px; left: 50%;
    transform: translateX(-50%);
}
.demo-orbit-dot:nth-child(2) { transform: rotate(120deg) translate(0, -60px); background: #b794ff; box-shadow: 0 0 12px #b794ff; }
.demo-orbit-dot:nth-child(3) { transform: rotate(240deg) translate(0, -60px); background: #6cb8ff; box-shadow: 0 0 12px #6cb8ff; }
.demo-orbit-dot:nth-child(1) { transform: rotate(0deg)   translate(0, -60px); }

.demo-brain-core {
    width: 64px; height: 64px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(94,224,193,0.35), rgba(94,224,193,0) 70%),
        rgba(8, 12, 22, 0.95);
    border: 1.5px solid rgba(94, 224, 193, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.6rem;
    box-shadow:
        0 0 30px rgba(94, 224, 193, 0.45),
        inset 0 0 22px rgba(94, 224, 193, 0.18);
    animation: core-pulse 2.2s ease-in-out infinite;
    z-index: 2;
}
@keyframes core-pulse {
    0%, 100% { transform: scale(1);    filter: brightness(1); }
    50%      { transform: scale(1.08); filter: brightness(1.25); }
}

/* roterende status-tekst onder brain */
.demo-brain-status {
    position: relative;
    height: 1.2rem;
    width: 11rem;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
}
.demo-brain-status span {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: status-cycle 8s linear infinite;
}
.demo-brain-status .s1 { animation-delay: 0s;   }
.demo-brain-status .s2 { animation-delay: 2s;   }
.demo-brain-status .s3 { animation-delay: 4s;   }
.demo-brain-status .s4 { animation-delay: 6s;   }
@keyframes status-cycle {
    0%, 22%, 100% { opacity: 0; transform: translateY(4px); }
    3%, 22%        { opacity: 1; transform: translateY(0); }
    25%            { opacity: 0; transform: translateY(-4px); }
}

/* ---------------- PACKETS langs de wires ---------------- */
.demo-packets {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.pkt {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    top: 0; left: 0;
    opacity: 0;
}

/* IN-packets: van links (10%) → centrum (50%, 50%) */
@keyframes pkt-in-flow {
    0%   { left: 12%;  top: var(--y); opacity: 0; }
    8%   { opacity: 1; }
    100% { left: 50%;  top: 50%;      opacity: 0; }
}
.pkt-in { animation: pkt-in-flow 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.pkt-i1 { --y: 12%; animation-delay: 0.0s; background: #5ee0c1; box-shadow: 0 0 10px #5ee0c1; }
.pkt-i2 { --y: 32%; animation-delay: 0.4s; background: #6cb8ff; box-shadow: 0 0 10px #6cb8ff; }
.pkt-i3 { --y: 52%; animation-delay: 0.8s; background: #ffcf6e; box-shadow: 0 0 10px #ffcf6e; }
.pkt-i4 { --y: 72%; animation-delay: 1.2s; background: #b794ff; box-shadow: 0 0 10px #b794ff; }
.pkt-i5 { --y: 92%; animation-delay: 1.6s; background: #ff9d7a; box-shadow: 0 0 10px #ff9d7a; }

/* OUT-packets: van centrum → rechts */
@keyframes pkt-out-flow {
    0%   { left: 50%; top: 50%;      opacity: 0; }
    10%  { opacity: 1; }
    100% { left: 88%; top: var(--y); opacity: 0; }
}
.pkt-out { animation: pkt-out-flow 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.pkt-o1 { --y: 12%; animation-delay: 1.1s; background: #b794ff; box-shadow: 0 0 10px #b794ff; }
.pkt-o2 { --y: 32%; animation-delay: 1.5s; background: #6cb8ff; box-shadow: 0 0 10px #6cb8ff; }
.pkt-o3 { --y: 52%; animation-delay: 1.9s; background: #5ee0c1; box-shadow: 0 0 10px #5ee0c1; }
.pkt-o4 { --y: 72%; animation-delay: 2.3s; background: #ffcf6e; box-shadow: 0 0 10px #ffcf6e; }
.pkt-o5 { --y: 92%; animation-delay: 2.7s; background: #ff6058; box-shadow: 0 0 10px #ff6058; }

/* ---------------- LIVE LOG (auto-scroll) ---------------- */
.demo-log {
    position: relative;
    height: 110px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-dim);
    mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}
.demo-log-inner {
    padding: 0.6rem 1rem;
    animation: log-scroll 22s linear infinite;
}
@keyframes log-scroll {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}
.demo-log-line {
    padding: 0.18rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.demo-log-line .t    { color: var(--text-mute); margin-right: 0.6rem; }
.demo-log-line .ok   { color: var(--accent);  font-weight: 700; margin-right: 0.4rem; }
.demo-log-line .warn { color: #ffcf6e;        font-weight: 700; margin-right: 0.4rem; }

/* ---------------- KPI's ---------------- */
.demo-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(0, 0, 0, 0.25);
}
.demo-stat {
    padding: 0.85rem 0.4rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.demo-stat:last-child { border-right: 0; }
.demo-stat-val {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.demo-stat-val small {
    font-size: 0.65em;
    color: var(--text-dim);
    margin-left: 1px;
}
.demo-stat-lbl {
    display: block;
    font-size: 0.66rem;
    color: var(--text-mute);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (prefers-reduced-motion: reduce) {
    .demo-pill, .demo-brain-ring, .demo-brain-orbit, .demo-brain-core,
    .demo-brain-status span, .pkt, .demo-log-inner, .demo-live-dot {
        animation: none !important;
    }
    .demo-brain-status span { opacity: 1; }
    .demo-brain-status span:not(.s1) { display: none; }
}

/* ============================================================
   17. CHAT WIDGET — opent vanuit de mascot
   ============================================================ */
#mascot.chat-active img { animation: mascot-wave 0.7s ease-in-out; }

.chat-widget {
    position: fixed;
    right: 1.25rem;
    bottom: 6.5rem;
    z-index: 100;
    width: min(360px, calc(100vw - 2rem));
    max-height: min(560px, calc(100vh - 8rem));
    background: linear-gradient(180deg, rgba(15, 22, 40, 0.98), rgba(8, 12, 22, 0.98));
    border: 1px solid rgba(94, 224, 193, 0.25);
    border-radius: 18px;
    box-shadow:
        0 20px 60px -10px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 80px -20px rgba(94, 224, 193, 0.35);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    backdrop-filter: blur(12px);
}
.chat-widget.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ---- header ---- */
.chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-avatar {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(94, 224, 193, 0.15);
    flex-shrink: 0;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-status-dot {
    position: absolute;
    right: -1px; bottom: -1px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #28c940;
    border: 2px solid rgba(8, 12, 22, 1);
    box-shadow: 0 0 8px rgba(40, 201, 64, 0.7);
}
.chat-header-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex: 1;
}
.chat-header-text strong { color: #fff; font-size: 0.95rem; }
.chat-header-text span   { color: var(--text-mute); font-size: 0.72rem; }
.chat-close {
    background: transparent;
    border: 0;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}
.chat-close:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

/* ---- body / messages ---- */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(94, 224, 193, 0.3) transparent;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(94, 224, 193, 0.3); border-radius: 3px; }

.chat-msg {
    display: flex;
    animation: chat-msg-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes chat-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-msg-bot { justify-content: flex-start; }
.chat-msg-me  { justify-content: flex-end; }

.chat-bubble {
    max-width: 80%;
    padding: 0.6rem 0.85rem;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #fff;
    white-space: pre-line;
    word-wrap: break-word;
}
.chat-msg-bot .chat-bubble {
    background: rgba(94, 224, 193, 0.10);
    border: 1px solid rgba(94, 224, 193, 0.25);
    border-bottom-left-radius: 4px;
}
.chat-msg-me .chat-bubble {
    background: rgba(155, 107, 255, 0.18);
    border: 1px solid rgba(155, 107, 255, 0.35);
    border-bottom-right-radius: 4px;
    color: #f0e8ff;
}

/* typing indicator */
.chat-typing .chat-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.8rem 0.85rem;
}
.chat-typing .chat-bubble span {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: chat-dot 1.2s ease-in-out infinite;
}
.chat-typing .chat-bubble span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing .chat-bubble span:nth-child(3) { animation-delay: 0.30s; }
@keyframes chat-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%           { transform: translateY(-4px); opacity: 1; }
}

/* ---- quick reply options ---- */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.18);
    max-height: 180px;
    overflow-y: auto;
}
.chat-option {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: rgba(94, 224, 193, 0.06);
    border: 1px solid rgba(94, 224, 193, 0.30);
    color: #fff;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    animation: chat-msg-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.chat-option:hover {
    background: rgba(94, 224, 193, 0.16);
    border-color: var(--accent);
    transform: translateY(-2px);
    color: #fff;
}
.chat-options .chat-option:nth-child(1) { animation-delay: 0.02s; }
.chat-options .chat-option:nth-child(2) { animation-delay: 0.07s; }
.chat-options .chat-option:nth-child(3) { animation-delay: 0.12s; }
.chat-options .chat-option:nth-child(4) { animation-delay: 0.17s; }
.chat-options .chat-option:nth-child(5) { animation-delay: 0.22s; }

/* ---- footer disclaimer ---- */
.chat-footer {
    padding: 0.55rem 0.9rem;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-mute);
    font-size: 0.68rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
}
.chat-footer i { color: var(--accent); }

@media (max-width: 600px) {
    .chat-widget {
        right: 0.75rem;
        bottom: 5.5rem;
        max-height: calc(100vh - 7rem);
    }
}
