/* Google Fonts loaded via <link rel="preload"> in HTML — not @import (avoids double render-block) */

/* =========================================
   CSS Reset
   ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========================================
   Scrollbar & Overflow
   ========================================= */

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

body {
    overflow-x: hidden;
}

/* Custom scrollbar (Webkit) */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* =========================================
   Core Utility Classes
   ========================================= */

@layer utilities {
    .glass-card {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .clip-path-circle-0 {
        clip-path: circle(0% at top right);
    }

    .clip-path-circle-100 {
        clip-path: circle(150% at top right);
    }
}

/* =========================================
   Scroll Reveal Animations
   ========================================= */

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* =========================================
   3D Tilt Card Effects
   ========================================= */

.tilt-3d {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}

.tilt-shine {
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Glass card hover glow */
.glass-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

/* =========================================
   Section Styling
   ========================================= */

/* section will-change removed — was promoting excessive GPU layers.
   Tilt transforms are applied inline via JS only when needed. */

/* =========================================
   Gradient Text Glow
   ========================================= */

.text-glow {
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.3),
        0 0 80px rgba(168, 85, 247, 0.15);
}

/* =========================================
   Animated Icons
   ========================================= */

.group:hover svg {
    animation: icon-pulse 0.6s ease-in-out;
}

@keyframes icon-pulse {
    0% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.15) rotate(-5deg);
    }

    50% {
        transform: scale(1.05) rotate(3deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* =========================================
   Navigation Bar Scroll Effect
   ========================================= */

nav {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

nav.nav-scrolled .glass-card {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

nav.nav-scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* =========================================
   Noise Overlay (used on blog/projects)
   ========================================= */

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.03;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* =========================================
   Mobile Optimizations
   ========================================= */

@media (max-width: 768px) {
    .glass-card {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .glass-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }

    section {
        transform: none !important;
    }

    .reveal-on-scroll {
        transform: translateY(20px);
    }

    .reveal-item {
        transform: translateY(15px);
    }

    /* Prevent about section horizontal overflow */
    main {
        overflow-x: hidden;
    }
}

/* =========================================
   Accessibility: Reduced Motion
   ========================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal-on-scroll,
    .reveal-item {
        opacity: 1;
        transform: none;
    }
}

/* =========================================
   Premium Skeleton Loading System
   =========================================
   Apple-inspired liquid-glass shimmer effect.
   Applied by default, removed when data arrives.
   ========================================= */

/* Base skeleton element */
.skel {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

.skel * {
    visibility: hidden;
}

/* Liquid-glass shimmer sweep */
.skel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255, 255, 255, 0.04) 38%,
        rgba(99, 102, 241, 0.06) 44%,
        rgba(168, 85, 247, 0.05) 50%,
        rgba(255, 255, 255, 0.04) 56%,
        transparent 64%
    );
    background-size: 300% 100%;
    animation: skel-shimmer 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes skel-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton shape variants */
.skel-text {
    height: 1em;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.skel-text-sm {
    height: 0.75em;
    border-radius: 0.25rem;
    margin-bottom: 0.375rem;
}

.skel-text-lg {
    height: 2.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.skel-text-xl {
    height: 3.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.skel-circle {
    border-radius: 50%;
    aspect-ratio: 1;
}

.skel-card {
    min-height: 220px;
    border-radius: 1rem;
}

.skel-tag {
    display: inline-block;
    height: 1.75rem;
    width: 5rem;
    border-radius: 9999px;
    margin-right: 0.5rem;
}

.skel-avatar {
    border-radius: 50%;
    width: 100%;
    height: 100%;
}

.skel-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
}

/* Subtle pulse overlay for depth */
.skel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.02);
    animation: skel-pulse 3s ease-in-out infinite;
    z-index: 0;
}

@keyframes skel-pulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* =========================================
   Content Fade-In Transition
   ========================================= */

.data-loaded {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Error Fallback State
   ========================================= */

.fb-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.fb-error-state .error-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.fb-error-state .error-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
}

.fb-error-state .error-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.5;
    max-width: 280px;
}

