/* ==========================================================================
   Connor Julian-Golding | Portfolio — Custom Animations & Modern UI Styles
   ========================================================================== */

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.78);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(226, 232, 240, 0.9);
    --accent-primary: #4f46e5;
    --accent-secondary: #7c3aed;
    --accent-glow: rgba(79, 70, 229, 0.28);
    --dot-color: #cbd5e1;
    --card-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.06);
    --card-hover-shadow: 0 24px 48px -12px rgba(79, 70, 229, 0.16), 0 8px 16px -8px rgba(15, 23, 42, 0.08);
}

html.dark {
    --bg-primary: #090d16;
    --bg-secondary: #111827;
    --bg-glass: rgba(17, 24, 39, 0.78);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(51, 65, 85, 0.65);
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-glow: rgba(99, 102, 241, 0.35);
    --dot-color: #1e293b;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45);
    --card-hover-shadow: 0 24px 48px -12px rgba(99, 102, 241, 0.25), 0 8px 16px -8px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-x: hidden;
}

/* Interactive Dotted Grid Background */
.bg-grid-pattern {
    background-image: radial-gradient(var(--dot-color) 1.25px, transparent 1.25px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 35%, #000 65%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 35%, #000 65%, transparent 100%);
}

/* Floating Ambient Gradient Blobs */
@keyframes floatSlow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(35px, -25px) scale(1.06);
    }
    66% {
        transform: translate(-25px, 20px) scale(0.95);
    }
}

.ambient-blob {
    animation: floatSlow 16s ease-in-out infinite;
    filter: blur(85px);
    pointer-events: none;
}

.ambient-blob-delayed {
    animation: floatSlow 20s ease-in-out infinite reverse;
    filter: blur(95px);
    pointer-events: none;
}

/* Glassmorphism Navigation */
.glass-nav {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   Animated Buttons (Shimmer, Magnetic, Ripple, Sliding Icons)
   ========================================================================== */

.btn-animated {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    font-weight: 600;
    border-radius: 0.875rem;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                background-color 0.28s ease,
                border-color 0.28s ease;
    will-change: transform;
    cursor: pointer;
    user-select: none;
}

/* Primary Gradient Button with Shimmer Sweep */
.btn-primary-glow {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
    background-size: 200% 200%;
    color: #ffffff;
    box-shadow: 0 10px 25px -5px var(--accent-glow), inset 0 1px 0 0 rgba(255, 255, 255, 0.25);
}

.btn-primary-glow::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 75%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent,
        rgba(255, 255, 255, 0.32),
        transparent
    );
    transform: skewX(-20deg);
    transition: left 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.btn-primary-glow:hover {
    transform: translateY(-3px) scale(1.015);
    box-shadow: 0 18px 35px -6px rgba(79, 70, 229, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.35);
    background-position: 100% 50%;
}

.btn-primary-glow:hover::before {
    left: 140%;
}

.btn-primary-glow:active {
    transform: translateY(0px) scale(0.97);
}

/* Secondary Glass Outline Button with Animated Border Fill */
.btn-secondary-glass {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.05);
}

.btn-secondary-glass::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.08));
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.btn-secondary-glass:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: 0 12px 24px -6px var(--accent-glow);
}

.btn-secondary-glass:hover::after {
    opacity: 1;
}

.btn-secondary-glass:active {
    transform: translateY(0) scale(0.97);
}

/* Card Action Button (Launch / Support) */
.btn-card-action {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-card-launch {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(124, 58, 237, 0.1));
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.22);
}

html.dark .btn-card-launch {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.18));
    color: #a5b4fc;
    border-color: rgba(129, 140, 248, 0.28);
}

.btn-card-launch:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff !important;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px var(--accent-glow);
}

/* Animated Icon Micro-Interactions inside Buttons */
.btn-icon-arrow {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-animated:hover .btn-icon-down {
    transform: translateY(3px);
}

.btn-animated:hover .btn-icon-diagonal,
.btn-card-action:hover .btn-icon-diagonal,
.project-card:hover .card-corner-arrow {
    transform: translate(3px, -3px);
}

.btn-animated:hover .btn-icon-right {
    transform: translateX(4px);
}

/* Click Ripple Effect */
.ripple-circle {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: rippleAnim 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    background-color: rgba(255, 255, 255, 0.38);
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(3.5);
        opacity: 0;
    }
}

/* ==========================================================================
   3D Spotlight & Tilt Project Cards
   ========================================================================== */

.project-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s ease;
    overflow: hidden;
    transform-style: preserve-3d;
}

/* Mouse-Tracking Radial Spotlight Overlay */
.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        520px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(99, 102, 241, 0.11),
        transparent 45%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1;
}

html.dark .project-card::before {
    background: radial-gradient(
        520px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(129, 140, 248, 0.16),
        transparent 45%
    );
}

.project-card:hover {
    box-shadow: var(--card-hover-shadow);
    border-color: rgba(99, 102, 241, 0.45);
}

.project-card:hover::before {
    opacity: 1;
}

/* Top Gradient Accent Bar on Card Hover */
.project-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #8b5cf6, #ec4899);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
}

.project-card:hover::after {
    transform: scaleX(1);
}

/* Filter Pill Animated Button */
.filter-btn {
    position: relative;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    box-shadow: 0 6px 18px -3px var(--accent-glow);
    border-color: transparent;
}

/* Scroll Reveal Animations */
.reveal-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Animated Gradient Text */
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-gradient-text {
    background: linear-gradient(120deg, #4f46e5, #7c3aed, #ec4899, #4f46e5);
    background-size: 250% 250%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientFlow 7s ease infinite;
}

html.dark .animate-gradient-text {
    background: linear-gradient(120deg, #818cf8, #c084fc, #f472b6, #818cf8);
    background-size: 250% 250%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Status Pulse Dot */
@keyframes pulseRing {
    0% { transform: scale(0.9); opacity: 0.8; }
    70% { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}

.pulse-dot::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: #10b981;
    animation: pulseRing 2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* Modal Backdrop & Transitions */
.modal-backdrop {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-panel {
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-backdrop.open .modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.6);
}

/* ==========================================================================
   Netlify Badge / HUD / Feedback Drawer Suppressor
   ========================================================================== */
#nl-badge-frame,
#nl-hud-frame,
iframe[id^="nl-"],
iframe[title*="Netlify" i],
iframe[src*="netlify" i],
.netlify-badge,
#netlify-badge,
#netlify-drawer,
[data-netlify-drawer] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    clip-path: path("M0 0Z") !important;
    position: absolute !important;
    bottom: -9999px !important;
    right: -9999px !important;
    z-index: -999999 !important;
}

