/* Base styles and Glassmorphism */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --bg-color: #050508;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --secondary-glow: rgba(147, 51, 234, 0.35);
    --font-heading: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html {
    background-color: var(--bg-color);
    color: #e5e5e5;
}

body {
    background-color: var(--bg-color);
    color: #d1d5db;
    overflow-x: hidden;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

h1, h2, h3, h4, .font-heading {
    font-family: var(--font-heading);
    letter-spacing: -0.03em;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

/* Glassmorphism & Panel Styling */
.glass-panel {
    background: rgba(13, 14, 20, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Interactive Spotlight Card (Phenomenon Studio & Nixtio signature) */
.spotlight-card {
    position: relative;
    background: rgba(13, 14, 22, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.35s ease, 
                box-shadow 0.35s ease,
                background-color 0.35s ease;
    overflow: hidden;
}

.spotlight-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(600px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(99, 102, 241, 0.14), transparent 45%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.spotlight-card::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(129, 140, 248, 0.3), transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 1px;
}

.spotlight-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
    background-color: rgba(18, 19, 28, 0.85);
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.7), 0 0 25px -5px rgba(99, 102, 241, 0.15);
}

.spotlight-card:hover::before,
.spotlight-card:hover::after {
    opacity: 1;
}

/* Shimmering Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, #60a5fa 0%, #c084fc 50%, #34d399 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shine 6s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Magnetic Buttons */
.magnetic-btn {
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s ease;
    will-change: transform;
}

.magnetic-btn:hover {
    box-shadow: 0 10px 30px -8px rgba(99, 102, 241, 0.4);
}

/* Infinite Kinetic Marquee */
.marquee-container {
    overflow: hidden;
    user-select: none;
    display: flex;
    gap: 2.5rem;
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.marquee-content {
    flex-shrink: 0;
    display: flex;
    justify-content: space-around;
    min-width: 100%;
    gap: 2.5rem;
    animation: marqueeScroll 35s linear infinite;
}

.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-100% - 2.5rem)); }
}

/* Custom Cursor & AI Robot Companion */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: #60a5fa;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #60a5fa;
    transition: opacity 0.2s, background-color 0.2s;
}


/* Hover State Reactions */
body.cursor-hover .cursor-dot {
    background: #34d399;
    box-shadow: 0 0 12px #34d399;
    opacity: 0.6;
}


/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #060608;
}
::-webkit-scrollbar-thumb {
    background: #262630;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3f3f50;
}

/* Navigation Link with animated underline */
.nav-link {
    position: relative;
    color: #9ca3af;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(to right, #60a5fa, #a855f7);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Interest card hover micro-animations */
.interest-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.interest-card:hover {
    transform: translateY(-8px);
}

.interest-card:hover .interest-icon {
    color: #fff;
    filter: drop-shadow(0 0 20px currentColor);
    transform: scale(1.12) rotate(-3deg);
}

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

/* Smart Tech Card Variants: AI Neural DAG, PCB Circuit, and Physical Engineering Blueprint */
.neural-card {
    background: linear-gradient(180deg, rgba(16, 11, 29, 0.8) 0%, rgba(9, 7, 18, 0.9) 100%);
    border-color: rgba(168, 85, 247, 0.22);
}
.neural-card:hover {
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.8), 0 0 35px -5px rgba(168, 85, 247, 0.25);
}

.pcb-card {
    background: linear-gradient(180deg, rgba(6, 26, 17, 0.8) 0%, rgba(3, 14, 9, 0.9) 100%);
    border-color: rgba(16, 185, 129, 0.22);
}
.pcb-card:hover {
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.8), 0 0 35px -5px rgba(16, 185, 129, 0.25);
}

.blueprint-card {
    background: linear-gradient(180deg, rgba(7, 23, 42, 0.8) 0%, rgba(4, 13, 26, 0.9) 100%);
    border-color: rgba(56, 189, 248, 0.22);
}
.blueprint-card:hover {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.8), 0 0 35px -5px rgba(56, 189, 248, 0.25);
}

/* Neural DAG & Synapse Animations */
@keyframes dagEdgeFlow {
    from { stroke-dashoffset: 36; }
    to { stroke-dashoffset: 0; }
}
@keyframes dagEdgeFlowRev {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: 36; }
}
@keyframes synapsePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px #a855f7); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 10px #c084fc); }
}
.dag-edge {
    stroke-dasharray: 5 4;
    animation: dagEdgeFlow 2s linear infinite;
}
.dag-edge-rev {
    stroke-dasharray: 5 4;
    animation: dagEdgeFlowRev 2.4s linear infinite;
}
.synaptic-node {
    transform-origin: center;
    animation: synapsePulse 3.5s ease-in-out infinite;
}

/* PCB Trace & SMT Circuit Animations */
@keyframes pcbSignalMove {
    from { stroke-dashoffset: 70; }
    to { stroke-dashoffset: 0; }
}
@keyframes pcbLedBlink {
    0%, 100% { opacity: 0.35; filter: drop-shadow(0 0 2px #10b981); }
    50% { opacity: 1; filter: drop-shadow(0 0 12px #34d399); }
}
.pcb-trace {
    stroke: #10b981;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.pcb-signal {
    stroke: #fbbf24;
    stroke-dasharray: 10 24;
    animation: pcbSignalMove 3s linear infinite;
}
.pcb-pad {
    fill: #f59e0b;
    stroke: #fbbf24;
}
.pcb-chip-body {
    fill: #05140d;
    stroke: #10b981;
    stroke-width: 1.5;
}
.pcb-led {
    animation: pcbLedBlink 1.8s ease-in-out infinite;
}

/* Blueprint & Physical Infrastructure Animations */
@keyframes fluidFlow {
    from { stroke-dashoffset: 40; }
    to { stroke-dashoffset: 0; }
}
@keyframes elecPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; filter: drop-shadow(0 0 9px #f59e0b); }
}
.pex-hot {
    stroke: #ef4444;
    stroke-dasharray: 6 5;
    animation: fluidFlow 2s linear infinite;
}
.pex-cold {
    stroke: #0ea5e9;
    stroke-dasharray: 6 5;
    animation: fluidFlow 2s linear infinite;
}
.elec-pulse {
    animation: elecPulse 2.2s ease-in-out infinite;
}

/* Timeline elements */
.timeline-line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    background: linear-gradient(to bottom, #3b82f6, #9333ea);
    height: 0%;
}

/* Homelab specific animations */
.data-path {
    stroke-dasharray: 10;
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: 1000;
    }
}

.ai-pulse {
    animation: aipulse 2.5s infinite alternate ease-in-out;
}

@keyframes aipulse {
    from { filter: drop-shadow(0 0 5px rgba(147, 51, 234, 0.4)); }
    to { filter: drop-shadow(0 0 22px rgba(147, 51, 234, 0.9)); }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

.floating-delayed {
    animation: float 6s ease-in-out 3s infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

/* --- Homelab System Topology & Flow Diagram --- */
.topology-grid-bg {
    background-image: radial-gradient(rgba(59, 130, 246, 0.12) 1px, transparent 1px);
    background-size: 24px 24px;
}

@keyframes flowPulseCyan {
    0% { stroke-dashoffset: 48; }
    100% { stroke-dashoffset: 0; }
}

@keyframes flowPulseAmber {
    0% { stroke-dashoffset: 48; }
    100% { stroke-dashoffset: 0; }
}

@keyframes flowPulseEmerald {
    0% { stroke-dashoffset: 48; }
    100% { stroke-dashoffset: 0; }
}

@keyframes flowPulsePurple {
    0% { stroke-dashoffset: 48; }
    100% { stroke-dashoffset: 0; }
}

.flow-line-ingress {
    stroke: #38bdf8;
    stroke-dasharray: 6 6;
    animation: flowPulseCyan 2.2s linear infinite;
}

.flow-line-control {
    stroke: #34d399;
    stroke-dasharray: 6 6;
    animation: flowPulseEmerald 2.5s linear infinite;
}

.flow-line-ai {
    stroke: #c084fc;
    stroke-dasharray: 6 6;
    animation: flowPulsePurple 2s linear infinite;
}

.flow-line-telemetry {
    stroke: #fbbf24;
    stroke-dasharray: 6 6;
    animation: flowPulseAmber 2.8s linear infinite;
}

/* Layer filter dimming and highlighting */
.topo-item {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.topo-filter-active .topo-item {
    opacity: 0.22;
    filter: grayscale(70%) blur(0.5px);
}

.topo-filter-active .topo-item.is-highlighted {
    opacity: 1;
    filter: none;
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.3);
}

.badge-metal {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.badge-vm {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #d8b4fe;
}

.badge-lxc {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.badge-docker {
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: #7dd3fc;
}

.badge-service {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}
