/* === 1. IMPORTS & VARIABLES === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@300;500;700;900&display=swap');

:root {
    /* Core Brand Colors */
    --brand: #7c3aed;
    --brand-hover: #6d28d9;
    --brand-glow: rgba(124, 58, 237, 0.4);
    
    /* Backgrounds */
    --bg-dark: #050505;
    --bg-card: #0f0f0f;
    --border-color: rgba(255, 255, 255, 0.08);
    
    /* Text */
    --text-main: #e5e5e5;
    --text-muted: #a1a1aa;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* Custom Text Selection */
::selection {
    background: var(--brand);
    color: #fff;
}

/* === 2. NOISE TEXTURE (The "Premium Paper" Effect) === */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    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.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* === 3. CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #262626;
    border-radius: 5px;
    border: 2px solid #0a0a0a;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand);
}

/* === 4. ANIMATIONS === */

/* Reveal (Slide Up) */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1); /* Ultra smooth Apple-style ease */
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* FAQ Accordion */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer {
    max-height: 400px; /* Generous height for long answers */
}

.faq-item i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy transition */
}

.faq-item.active i {
    transform: rotate(45deg);
    color: var(--brand);
}

/* Hover Lifts for Cards/Buttons */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* === 5. MARQUEE (CRITICAL FIX) === */
.marquee-wrap {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 40px 0; /* Comfortable spacing */
    /* Gradient Mask to fade edges */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
    display: flex;
    flex-wrap: nowrap;         /* FORCE single line */
    width: max-content;        /* FORCE width to fit content */
    gap: 30px;                 /* Spacing between cards */
    animation: scroll 60s linear infinite; /* Slow and smooth */
    padding-left: 20px;        /* Initial offset */
}

/* Pause on hover for readability */
.marquee-content:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* === 6. MASONRY GRID (Portfolio) === */
.masonry-grid {
    column-count: 1;
    column-gap: 2rem;
}

@media (min-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (min-width: 1280px) {
    .masonry-grid {
        column-count: 3;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    backface-visibility: hidden;
    transform: translateZ(0); /* Fix for some browsers flickering */
}

/* === 7. UTILITIES & COMPONENT STYLES === */

/* Gradient Text */
.text-gradient {
    background: linear-gradient(to right, #fff, #9ca3af);
    -webkit-background-clip: text;
    color: transparent;
}

/* Glassmorphism Card Utility (Optional usage) */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Image Modal Overlay */
#image-modal {
    background-color: rgba(0, 0, 0, 0.92); /* Darker background */
    backdrop-filter: blur(8px);
}

/* Mobile Nav Fixes (if needed) */
@media (max-width: 768px) {
    .marquee-content {
        animation-duration: 40s; /* Faster on mobile since screen is smaller */
    }
    .reveal {
        transition-duration: 0.6s; /* Snappier on mobile */
    }
}
