/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Kufi Font Override where needed */
.font-kufi {
    font-family: 'Reem Kufi', sans-serif;
}

@keyframes lineFlow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -1200; }
}

.bg-lines {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.bg-lines svg {
    width: 100%;
    height: 100%;
}

.bg-lines path {
    fill: none;
    stroke: rgba(16, 185, 129, 0.08);
    stroke-width: 0.6;
    stroke-linecap: round;
    stroke-dasharray: 4 18;
    animation: lineFlow 45s linear infinite;
}

.bg-lines path.alt {
    stroke: rgba(16, 185, 129, 0.05);
    stroke-dasharray: 3 16;
    animation-duration: 60s;
}

.dark .bg-lines path, .dark .bg-lines path.alt {
    stroke: rgba(16, 185, 129, 0.12);
}
@keyframes gridDrift {
    0% { background-position: 0 0, 0 0; }
    50% { background-position: -20px 20px, -20px 20px; }
    100% { background-position: 0 0, 0 0; }
}
.gradient-outline {
    position: relative;
}
.gradient-outline::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    padding: 1.5px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(59, 130, 246, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(16, 185, 129, 0.12) 1px, transparent 1px);
    background-size: 42px 42px;
    animation: gridDrift 25s linear infinite;
}
.bg-grid::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 60%),
        radial-gradient(circle at 15% 20%, rgba(59,130,246,0.12), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(16,185,129,0.12), transparent 45%);
}
.dark .bg-grid {
    background-image:
        linear-gradient(to right, rgba(59, 130, 246, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(16, 185, 129, 0.12) 1px, transparent 1px);
}
.dark .bg-grid::before {
    background:
        radial-gradient(ellipse at center, rgba(15,23,42,0.6) 0%, rgba(15,23,42,0) 60%),
        radial-gradient(circle at 15% 20%, rgba(59,130,246,0.12), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(16,185,129,0.12), transparent 45%);
}
@media (prefers-reduced-motion: reduce) {
    .bg-grid { animation: none; }
}
@media (max-width: 640px) {
    .bg-grid { animation: none; }
}
.cv-auto {
    content-visibility: auto;
    contain-intrinsic-size: 800px;
}
.site-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(ellipse at center, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 60%), image-set(url('./assets/site-bg-day@2x.jpg') 1x, url('./assets/site-bg-day@2x.jpg') 2x);
    background-size: auto, cover;
    background-position: center center, center center;
    background-repeat: no-repeat, no-repeat;
}
.dark .site-bg {
    background-image: radial-gradient(ellipse at center, rgba(15,23,42,0.6) 0%, rgba(15,23,42,0) 60%), image-set(url('./assets/site-bg-night@2x.jpg') 1x, url('./assets/site-bg-night@2x.jpg') 2x);
    background-size: auto, cover;
    background-position: center center, center center;
    background-repeat: no-repeat, no-repeat;
}
@media (min-width: 1024px) {
    .site-bg { background-position: center top; }
    .dark .site-bg { background-position: center top; }
}
