/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #fafbfc;
    color: #1a1a2e;
    overflow-x: hidden;
    -webkit-user-select: text;
    user-select: text;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Prevent long-press context menu on mobile */
img, a, button {
    -webkit-touch-callout: none;
}

/* Prevent selection only on decorative elements (icons, pseudo-elements) */
.icon-glow,
svg {
    -webkit-user-select: none;
    user-select: none;
}

/* ===== Typography ===== */
.gradient-text {
    background: linear-gradient(135deg, #00e5ff, #b388ff, #1de9b6, #00e5ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
}

.gradient-text-animated {
    background: linear-gradient(90deg, #00e5ff, #b388ff, #1de9b6, #ff4081, #00e5ff);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

/* ===== Navigation ===== */
.nav-link {
    position: relative;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00e5ff, #b388ff);
    transition: width 0.3s ease;
}

.nav-glass {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(250,251,252,0.85);
    border-bottom: 1px solid rgba(0,229,255,0.1);
}

/* ===== Mobile Menu ===== */
.mobile-menu {
    transition: all 0.3s ease;
}

.mobile-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    max-height: 500px;
    overflow-y: auto;
}

.mobile-menu.closed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ===== Background & Patterns ===== */
.neural-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.neural-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0,229,255,0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(179,136,255,0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(29,233,182,0.03) 0%, transparent 50%);
}

.grid-pattern {
    background-image:
        linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.hero-grid {
    background-image:
        linear-gradient(rgba(0,229,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,229,255,0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

/* ===== Glow Effects ===== */
.glow-cyan {
    text-shadow: 0 0 20px rgba(0,229,255,0.5), 0 0 40px rgba(0,229,255,0.2);
}

.glow-cyan-subtle {
    text-shadow: 0 0 10px rgba(0,229,255,0.3);
}

.glow-purple {
    text-shadow: 0 0 20px rgba(179,136,255,0.5), 0 0 40px rgba(179,136,255,0.2);
}

/* ===== Cards ===== */
.card-glow {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-glow {
    transition: all 0.4s ease;
}

/* ===== Buttons ===== */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.btn-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,229,255,0.2), rgba(179,136,255,0.2));
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* ===== Hover Effects (desktop only) ===== */
/* Wrapping all hover effects in media query to prevent ghost-hover on touch devices */
@media (hover: hover) {
    .nav-link:hover {
        color: #00e5ff;
        text-shadow: 0 0 10px rgba(0,229,255,0.3);
    }

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

    .card-glow:hover {
        border-color: rgba(0,229,255,0.4);
        box-shadow:
            0 0 15px rgba(0,229,255,0.15),
            0 0 30px rgba(0,229,255,0.1),
            inset 0 0 15px rgba(0,229,255,0.05);
        transform: translateY(-4px);
    }

    .card-glow:hover .icon-glow {
        filter: drop-shadow(0 0 8px rgba(0,229,255,0.6));
        transform: scale(1.1);
    }

    .btn-glow:hover::before {
        opacity: 1;
    }

    .btn-glow:hover {
        box-shadow:
            0 0 20px rgba(0,229,255,0.4),
            0 0 40px rgba(0,229,255,0.2);
        transform: translateY(-2px);
    }

    .hover-scale:hover {
        transform: scale(1.05);
    }

    .back-to-top:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,229,255,0.4);
    }

    .ripple::after {
        transition: width 0.6s, height 0.6s;
    }

    .ripple:hover::after {
        width: 300px;
        height: 300px;
    }
}

/* ===== Animations ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal[data-reveal-delay="1"] { transition-delay: 0.1s !important; }
.reveal[data-reveal-delay="2"] { transition-delay: 0.2s !important; }
.reveal[data-reveal-delay="3"] { transition-delay: 0.3s !important; }
.reveal[data-reveal-delay="4"] { transition-delay: 0.4s !important; }

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ===== Floating particles ===== */
@media (prefers-reduced-motion: no-preference) {
    .particle {
        position: absolute;
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: rgba(0,229,255,0.4);
        animation: float 6s ease-in-out infinite;
    }

    .particle:nth-child(odd) {
        background: rgba(179,136,255,0.4);
        animation-duration: 8s;
    }

    .particle:nth-child(3n) {
        background: rgba(29,233,182,0.4);
        animation-duration: 10s;
    }
}

@media (max-width: 640px) {
    .particle { display: none !important; }
}

/* ===== Feature items ===== */
.feature-item {
    transition: all 0.3s ease;
}

/* ===== Decorative lines ===== */
.circuit-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(0,229,255,0.15), transparent);
    height: 1px;
}

.circuit-line-v {
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, transparent, rgba(0,229,255,0.15), transparent);
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,229,255,0.3), rgba(179,136,255,0.3), transparent);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0,229,255,0.5), rgba(179,136,255,0.5));
    border-radius: 3px;
}

/* ===== Form inputs ===== */
.form-input:focus {
    border-color: rgba(0,229,255,0.6);
    box-shadow: 0 0 0 3px rgba(0,229,255,0.1), 0 0 15px rgba(0,229,255,0.1);
}

/* ===== Hex grid ===== */
.hex-grid {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* ===== Timeline ===== */
.timeline-line {
    background: linear-gradient(180deg, rgba(0,229,255,0.6), rgba(179,136,255,0.6), rgba(29,233,182,0.6));
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #00e5ff, #b388ff);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,229,255,0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* ===== Skip to content link (accessibility) ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #00e5ff;
    color: #1a1a2e;
    padding: 8px 16px;
    z-index: 100;
    font-size: 14px;
    text-decoration: none;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ===== Ripple effect ===== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0,229,255,0.3);
    transform: translate(-50%, -50%);
}

/* ===== Language flags support ===== */
.flag, [data-lang], select option {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif !important;
}

/* ===== Language flags support ===== */
#langDropdownDesktop a {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', 'Inter', sans-serif !important;
    font-size: 1rem !important;
}
#langSelectDesktop {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', 'Inter', sans-serif !important;
}

/* ===== Fix emoji flags in language dropdown ===== */
#langDropdownDesktop a {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif !important;
}
#langSelectDesktop {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif !important;
}
#langSwitcherDesktop .flag {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif !important;
}

/* ===== Fix SVG flags display ===== */
#langDropdownDesktop svg,
#langSelectDesktop svg,
#currentLangDisplay svg {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 6px !important;
}

/* ===== Mobile language switcher ===== */
@media (max-width: 767px) {
    #langSwitcherMobile {
        display: block !important;
    }
    #langSelectMobile {
        font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', 'Inter', sans-serif !important;
    }
    #langDropdownMobile svg,
    #langSelectMobile svg,
    #currentLangMobileDisplay svg {
        display: inline-block !important;
        vertical-align: middle !important;
        margin-right: 4px !important;
    }
}
@media (min-width: 768px) {
    #langSwitcherMobile {
        display: none !important;
    }
}
