/* ==========================================
   PREMIUM UI EFFECTS
   (Loaded last so it can layer over base styles)
========================================== */

/* ==========================================
   1. CINEMATIC FILM GRAIN OVERLAY
========================================== */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0.045;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================
   2. MOUSE-TRACKING SPOTLIGHT GLOW CARDS
========================================== */
.spotlight {
    position: relative;
}

.spotlight::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%),
            rgba(176, 141, 62, 0.12), transparent 65%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.spotlight:hover::after {
    opacity: 1;
}

/* ==========================================
   3. ANIMATED GRADIENT TEXT
========================================== */
.gradient-text {
    background-size: 200% auto;
    animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* ==========================================
   4. SECTION TITLE BADGE BREATHING GLOW
========================================== */
.section-title span {
    animation: pulseGlow 3.5s ease-in-out infinite;
}

/* ==========================================
   5. ANIMATED HERO GRID BACKGROUND
========================================== */
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(176, 141, 62, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(176, 141, 62, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 45%, #000 25%, transparent 78%);
    mask-image: radial-gradient(ellipse 62% 58% at 50% 45%, #000 25%, transparent 78%);
    animation: gridPan 18s linear infinite;
}

@keyframes gridPan {
    to { background-position: 56px 56px; }
}

/* ==========================================
   6. SEAMLESS TECH MARQUEE
========================================== */
.tech-stack {
    background: var(--background-light);
}

.tech-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    backdrop-filter: blur(12px);
    transition: var(--transition-fast);
}

.tech-item i {
    font-size: 1.1rem;
    color: var(--primary);
    transition: var(--transition-fast);
}

.tech-item:hover {
    background: rgba(176, 141, 62, 0.12);
    color: var(--text);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.tech-item:hover i {
    transform: scale(1.15);
    color: var(--primary-dark);
}

html.dark .tech-item:hover {
    color: var(--white);
}

html.dark .tech-item:hover i {
    color: var(--primary);
}

.tech-marquee {
    position: relative;
    overflow: hidden;
    padding: 12px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    gap: 0;
}

.marquee-group {
    display: flex;
    align-items: center;
    gap: 0;
}

.marquee-group .tech-item {
    margin-right: 16px;
}

.tech-marquee.marquee-ready .marquee-track {
    animation: marquee 34s linear infinite;
}

.tech-marquee.marquee-ready:hover .marquee-track {
    animation-play-state: paused;
}

@keyframes marquee {
    to { transform: translateX(-50%); }
}

/* ==========================================
   7. KEYBOARD ACCESSIBILITY (FOCUS VISIBLE)
========================================== */
:where(a, button, input, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ==========================================
   8. BUTTON MICRO-INTERACTIONS
========================================== */
.btn:active {
    transform: translateY(0) scale(0.98);
}
