@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Global Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 40px rgba(59, 130, 246, 0.5); }
}

@keyframes move {
    from { 
        transform: translate(0, 0) scale(1); 
    }
    to { 
        transform: translate(100px, 50px) scale(1.2); 
    }
}

@keyframes moveAlt {
    0% { 
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    50% {
        transform: translate(150px, -100px) scale(1.1) rotate(180deg);
    }
    100% { 
        transform: translate(0, 0) scale(1) rotate(360deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-40px) translateX(30px);
    }
    50% {
        transform: translateY(-80px) translateX(-20px);
    }
    75% {
        transform: translateY(-40px) translateX(-40px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

@keyframes waveAnimation {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-30px) translateX(20px);
    }
}

@keyframes lineWave {
    0% {
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes circuitPulse {
    0%, 100% {
        stroke-opacity: 0.2;
        stroke-width: 2;
    }
    50% {
        stroke-opacity: 0.5;
        stroke-width: 3;
    }
}

@keyframes nodeFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    }
    50% {
        transform: translate(10px, -10px) scale(1.1);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(45, 212, 191, 0.4);
    }
}

@keyframes codeFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
        opacity: 0.6;
    }
}

@keyframes neonGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.4), inset 0 0 5px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.8), inset 0 0 10px rgba(45, 212, 191, 0.4);
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-500px) translateX(100px) scale(0);
        opacity: 0;
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.slide-in {
    animation: slideIn 0.8s ease-out forwards;
}

/* Glassmorphism Effect */
.glass-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 30px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.045) 100%);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 16px 42px rgba(0, 0, 0, 0.26);
}

.glass-nav {
    background: linear-gradient(180deg, rgba(5, 5, 5, 0.55) 0%, rgba(5, 5, 5, 0.3) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    transition: all 0.3s ease;
}

.nav-bookmarks {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    min-width: 0;
}

.section-bookmarks-track {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    border-radius: 999px;
    padding: 0.32rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    overflow-x: auto;
}

.bookmark-indicator {
    position: absolute;
    left: 0;
    top: 4px;
    height: calc(100% - 8px);
    width: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(59, 130, 246, 0.12));
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.22);
    transform: translateX(0);
    opacity: 0;
    transition: transform 0.32s ease, width 0.32s ease, opacity 0.2s ease;
    pointer-events: none;
}

.bookmark-link {
    position: relative;
    z-index: 1;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
    transition: color 0.25s ease, background-color 0.25s ease;
}

.bookmark-link:hover,
.bookmark-link.text-white {
    color: #ffffff;
}

.bookmark-link.is-active {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
}

@media (max-width: 640px) {
    .nav-bookmarks {
        padding: 0;
        flex-basis: 100%;
    }

    .section-bookmarks-track {
        justify-content: flex-start;
        padding: 0.24rem;
        gap: 0.1rem;
        border-radius: 14px;
        scrollbar-width: none;
    }

    .section-bookmarks-track::-webkit-scrollbar {
        display: none;
    }

    .bookmark-link {
        font-size: 10px;
        letter-spacing: 0.06em;
        padding: 0.38rem 0.62rem;
    }

    .bookmark-indicator {
        top: 3px;
        height: calc(100% - 6px);
    }
}

section[id],
footer[id] {
    scroll-margin-top: 132px;
}

@media (max-width: 768px) {
    section[id],
    footer[id] {
        scroll-margin-top: 186px;
    }
}

/* Navigation Link Effect */
.nav-link {
    position: relative;
    display: inline-block;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, transparent);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after {
    width: 100%;
}

/* Typography Details */
.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #a1a1a1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s infinite;
}

/* Smooth Hover Effects */
.hover-trigger {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hover-trigger:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-12px);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.15);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Background Base */
body {
    background-color: #050505;
    position: relative;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

nav,
main,
footer {
    transition: opacity 0.75s ease, transform 0.75s ease, filter 0.75s ease;
}

body.intro-mode nav,
body.intro-mode main,
body.intro-mode footer {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(8px);
    pointer-events: none;
}

body.intro-mode .skip-link {
    display: none;
}

.hero-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-reveal.hero-reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    filter: blur(4px);
    transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
    margin-right: 0.36em;
}

.hero-word.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.skip-link {
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 60;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #ffffff;
    color: #050505;
    transform: translateY(-140%);
    transition: transform 0.25s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.content-source {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
}

.content-source::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.9);
    outline-offset: 2px;
}

.faq-item summary {
    list-style: none;
    position: relative;
    padding-right: 28px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #3b82f6;
    font-size: 18px;
    font-weight: 700;
}

.faq-item[open] summary::after {
    content: '-';
}

.hidden {
    display: none !important;
}

.contact-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.contact-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 5, 10, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.contact-modal-panel {
    width: min(460px, 100%);
    position: relative;
    z-index: 1;
    padding: 1.8rem;
    border-radius: 1.25rem;
}

.contact-modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #f3f4f6;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.contact-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Live Background */
.bg-visuals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.matrix-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.42;
    mix-blend-mode: screen;
}

.matrix-intro {
    position: absolute;
    left: 50%;
    top: 18%;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 2rem));
    padding: 16px 18px;
    border: 1px solid rgba(74, 222, 128, 0.3);
    background: rgba(2, 10, 5, 0.62);
    border-radius: 10px;
    box-shadow: 0 0 28px rgba(34, 197, 94, 0.2);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: rgba(74, 222, 128, 0.95);
    line-height: 1.65;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0;
    animation: matrixIntroIn 0.35s ease-out 0.15s forwards, matrixIntroOut 0.9s ease-in 2.8s forwards;
}

.matrix-intro.matrix-intro-exit {
    animation: matrixIntroOut 0.55s ease-in forwards;
}

.matrix-line {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes matrixIntroIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes matrixIntroOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px);
    }
}

/* Grid Background */
.bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(59, 130, 246, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.4;
    animation: pulse 8s ease-in-out infinite;
}

/* Animated Blobs */
.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: moveAlt 25s infinite ease-in-out;
    pointer-events: none;
    mix-blend-mode: screen;
}

.blob-1 { 
    top: -10%; 
    left: -10%; 
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%); 
    animation-duration: 28s;
    animation-delay: 0s;
}

.blob-2 { 
    bottom: -10%; 
    right: -10%; 
    background: radial-gradient(circle, rgba(45, 212, 191, 0.12) 0%, transparent 70%); 
    animation-delay: -8s;
    animation-duration: 32s;
}

.blob-3 {
    top: 30%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    animation-duration: 35s;
    animation-delay: -15s;
}

/* Floating Orbs */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    mix-blend-mode: screen;
    animation: float 15s ease-in-out infinite;
}

.orb-1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 80%);
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 80%);
    bottom: 20%;
    right: 15%;
    animation-delay: -5s;
    animation-duration: 18s;
}

.orb-3 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 80%);
    top: 50%;
    right: 10%;
    animation-delay: -10s;
    animation-duration: 20s;
}

/* Gradient Waves */
.gradient-wave {
    position: absolute;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(59, 130, 246, 0.05) 50%, transparent 70%);
    animation: waveAnimation 20s ease-in-out infinite;
    pointer-events: none;
}

.wave-1 {
    top: -50%;
    left: -50%;
    animation-delay: 0s;
}

.wave-2 {
    bottom: -50%;
    right: -50%;
    background: linear-gradient(225deg, transparent 30%, rgba(45, 212, 191, 0.03) 50%, transparent 70%);
    animation-delay: -10s;
}

/* Circuit Network SVG */
.circuit-network {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: screen;
}

.circuit-line {
    stroke-dasharray: 500;
    animation: circuitPulse 4s ease-in-out infinite;
    filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.5));
}

/* Data Flow Nodes */
.data-nodes {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.node {
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.8) 0%, rgba(45, 212, 191, 0.4) 100%);
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.6);
    animation: nodeFloat 4s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.3));
}

.node-1 { top: 15%; left: 5%; animation-delay: 0s; }
.node-2 { top: 25%; left: 30%; animation-delay: -0.8s; }
.node-3 { top: 60%; left: 65%; animation-delay: -1.6s; }
.node-4 { top: 75%; left: 15%; animation-delay: -2.4s; }
.node-5 { top: 40%; right: 10%; animation-delay: -3.2s; }
.node-6 { bottom: 20%; left: 50%; animation-delay: -4s; }

/* Code Elements */
.code-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.code-char {
    position: absolute;
    font-size: 24px;
    color: rgba(59, 130, 246, 0.3);
    animation: codeFloat 6s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3), 0 0 20px rgba(45, 212, 191, 0.2);
    letter-spacing: 2px;
}

.char-1 { top: 10%; left: 8%; animation-delay: 0s; }
.char-2 { top: 35%; right: 12%; animation-delay: -1s; }
.char-3 { top: 50%; left: 3%; animation-delay: -2s; }
.char-4 { bottom: 25%; right: 8%; animation-delay: -3s; }
.char-5 { top: 70%; left: 20%; animation-delay: -4s; }
.char-6 { top: 45%; right: 5%; animation-delay: -5s; }

/* Neon Lines */
.neon-line {
    position: absolute;
    pointer-events: none;
    border: 1px solid rgba(59, 130, 246, 0.3);
    animation: neonGlow 3s ease-in-out infinite;
}

.neon-1 {
    top: 10%;
    left: 5%;
    width: 200px;
    height: 2px;
    transform: rotate(15deg);
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), transparent);
    animation-delay: 0s;
}

.neon-2 {
    top: 60%;
    right: 10%;
    width: 150px;
    height: 2px;
    transform: rotate(-25deg);
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.5), transparent);
    animation-delay: -1s;
}

.neon-3 {
    bottom: 15%;
    left: 50%;
    width: 180px;
    height: 2px;
    transform: rotate(30deg);
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), transparent);
    animation-delay: -2s;
}

/* Animated Lines SVG */
.animated-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.15;
}

.line-animation {
    stroke-dasharray: 500;
    animation: lineWave 8s ease-in-out infinite;
}

/* Particle System */
#particle-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    mix-blend-mode: screen;
}

.particle-dot {
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.8) 0%, transparent 100%);
    animation: particleFloat 8s ease-out forwards;
}

.particle-dot.small {
    width: 2px;
    height: 2px;
    animation-duration: 6s;
}

.particle-dot.large {
    width: 5px;
    height: 5px;
    animation-duration: 10s;
}

/* Section Spacing */
section {
    position: relative;
    z-index: 1;
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.5px;
}

/* Button Enhancements */
button, a[class*="bg-"] {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .bg-grid {
        background-size: 30px 30px;
    }
    
    .blob {
        width: 300px;
        height: 300px;
    }
    
    .blob-3 {
        width: 250px;
        height: 250px;
    }
    
    .floating-orb {
        filter: blur(25px);
    }

    .matrix-canvas {
        opacity: 0.28;
    }

    .matrix-intro {
        top: 13%;
        font-size: 10px;
    }
}

/* Intersection Observer Animation Support */
[data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
