body {
    background-color: #000000;
    color: #ffffff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.film-grain {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

.page-wrapper {
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 0; left: 0; width: 100%;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    visibility: hidden;
}
.page-wrapper.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    transform: translateY(0);
    visibility: visible;
}

.glitch-text {
    position: relative;
    display: inline-block;
}
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0.8;
    pointer-events: none;
}
.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #0ff;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}
.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #f0f;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 86px, 0); }
    20% { clip: rect(25px, 9999px, 93px, 0); }
    40% { clip: rect(41px, 9999px, 12px, 0); }
    60% { clip: rect(98px, 9999px, 45px, 0); }
    80% { clip: rect(15px, 9999px, 76px, 0); }
    100% { clip: rect(83px, 9999px, 23px, 0); }
}

.tech-sphere {
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(30,40,50,0.4), rgba(0,0,0,0.9));
    box-shadow: inset 0 0 60px rgba(0,255,255,0.05), 0 0 120px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    overflow: hidden;
}
.tech-sphere::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,0.03) 5px, rgba(255,255,255,0.03) 10px);
}

.glass-panel {
    background: linear-gradient(180deg, rgba(15,15,15,0.8) 0%, rgba(5,5,5,0.9) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
}

input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #000 inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── Carousels ─────────────────────────────────────────── */

.carousel-container {
    position: relative;
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #080808;
}

.carousel-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}

.carousel-slide:hover .carousel-slide-bg {
    transform: scale(1.03);
}

.carousel-content-link {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
    z-index: 20;
    backdrop-filter: blur(8px);
}

.carousel-slide:hover .carousel-content-link {
    opacity: 1;
    transform: scale(1);
}

.carousel-content-link:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.4rem;
    z-index: 20;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dot.active {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.4);
}

/* ── Milestones & certificates: shared bottom-left caption chip ── */

.caption-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    line-height: 1.2;
    font-weight: 500;
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    display: inline-block;
    margin-bottom: 0.75rem;
    letter-spacing: 0.06em;
}

.milestone-caption {
    position: absolute;
    left: 1rem;
    bottom: 3.25rem;
    z-index: 10;
    max-width: calc(100% - 2rem);
    width: max-content;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    background: #000000;
    border-radius: 0.5rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.milestone-caption__title {
    font-family: 'Playfair Display', serif;
    font-size: 1.125rem;
    line-height: 1.25;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.375rem 0;
    text-shadow: none;
}

.milestone-caption__desc {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.45;
    font-weight: 400;
    color: #9ca3af;
    margin: 0;
    text-shadow: none;
}

@media (min-width: 768px) {
    .milestone-caption {
        left: 1.25rem;
        bottom: 3.5rem;
        padding: 0.875rem 1.125rem;
    }

    .milestone-caption__title {
        font-size: 1.25rem;
    }

    .milestone-caption__desc {
        font-size: 0.75rem;
    }
}

/* ── Feed carousel (mobile X / LinkedIn) ───────────────── */

.feed-panel-mobile {
    position: relative;
    overflow: hidden;
}

.feed-track {
    display: flex;
    flex-direction: row;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    .feed-panel-mobile {
        overflow: visible;
    }

    .feed-track {
        flex-direction: column;
        gap: 1rem;
        transform: none !important;
    }
}

.feed-slide {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 1024px) {
    .feed-slide {
        flex: 0 0 auto;
        min-width: 0;
        width: 100%;
    }
}

.feed-swipe-hint {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #39ff14;
    opacity: 0.5;
    pointer-events: none;
    z-index: 5;
}

.feed-swipe-hint.hidden {
    display: none;
}
