:root {
    /* Cyber-Industrial Palette */
    --bg-dark: #050A14;
    /* Deep Night */
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-primary: #E6F1FF;
    --text-secondary: #8892B0;
    --accent-cyan: #00F0FF;
    /* Neon Cyan */
    --accent-orange: #FF4D00;
    /* Electric Orange */

    --font-main: 'Vazirmatn', sans-serif;

    --transition: all 0.3s ease;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-secondary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
    /* RTL Support */
}

/* Canvas Background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    /* Behind everything */
    pointer-events: none;
}

h1,
h2,
h3,
h4 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.text-gradient {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-orange));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: var(--glass-border);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 4px;
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.btn-primary:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    text-shadow: 0 0 8px var(--accent-cyan);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(255, 77, 0, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 77, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 77, 0, 0.4);
}


/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-bg-fallback {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #0d1b2a 0%, #050a14 100%);
    position: relative;
    transform: scale(1.1);
}

.hero-bg-fallback::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, #050A14 90%);
}

.hero-content {
    z-index: 2;
    max-width: 900px;
    padding: 20px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

/* Glitch Animation */
.glitch-text {
    position: relative;
}

/* (Simplified glitch effect for stability) */
.hero h1:hover {
    text-shadow: 2px 2px var(--accent-orange), -2px -2px var(--accent-cyan);
    transition: 0.1s;
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    color: var(--text-secondary);
}

/* Services Grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.glowing-card {
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition);
}

.glowing-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-orange);
    box-shadow: 0 0 20px rgba(255, 77, 0, 0.2);
}

.glowing-card .icon {
    width: 50px;
    height: 50px;
    color: var(--accent-cyan);
    margin-bottom: 20px;
    transition: var(--transition);
}

.glowing-card:hover .icon {
    color: var(--accent-orange);
    filter: drop-shadow(0 0 8px var(--accent-orange));
}

/* About Section & HUD */
.split-layout {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-direction: row-reverse;
    /* Flip visual order for RTL if needed, but flex-direction: row is default RTL in CSS flexbox? No, flex follows direction. */
}

/* Actually, with dir=rtl, row is right-to-left. So item 1 is right, item 2 is left.
   We want Text (Right) and Image (Left).
   HTML order: Text, Image.
   RTL Flex default: Text starts on right. Correct.
*/

.line-accent {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-orange), transparent);
    margin: 20px 0;
}

.tech-hud {
    position: relative;
    border: 1px solid var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
    background: rgba(0, 10, 20, 0.6);
    overflow: hidden;
}

/* HUD Overlay Styles */
.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hud-line {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100px;
    height: 2px;
    background: var(--accent-cyan);
}

.hud-circle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: 2px dashed var(--accent-orange);
    border-radius: 50%;
    animation: spin 10s linear infinite;
}

.hud-text {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: var(--accent-cyan);
    font-family: monospace;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Product Showcase - Horizontal Scroll */
.product-gallery-wrapper {
    overflow: hidden;
    margin-top: 50px;
    /* Optional: Fade masks on sides */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.product-gallery {
    display: flex;
    /* Horizontal row */
    gap: 40px;
    padding: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    justify-content: center;
    /* Center if few items */
}

.product-gallery::-webkit-scrollbar {
    display: none;
}

.product-card {
    min-width: 300px;
    max-width: 300px;
    flex-shrink: 0;
    position: relative;
    padding-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    transform: scale(1.05);
    z-index: 2;
    border-color: var(--accent-cyan);
}

.product-placeholder {
    height: 220px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.product-icon {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    opacity: 0.5;
    transition: var(--transition);
}

.product-card:hover .product-icon {
    color: var(--accent-cyan);
    opacity: 1;
    filter: drop-shadow(0 0 10px var(--accent-cyan));
}

.floating-tag {
    position: absolute;
    background: rgba(5, 10, 20, 0.8);
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    padding: 4px 8px;
    font-size: 0.7rem;
    border-radius: 4px;
    font-family: monospace;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 77, 0, 0.3);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.product-info {
    padding: 20px;
    text-align: center;
}

.tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.tag {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
}

/* Footer (RTL Friendly) */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 50px 0 20px;
    margin-top: 50px;
    text-align: center;
    background: #020408;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--accent-orange);
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icons a {
    color: var(--text-primary);
    transition: var(--transition);
}

.social-icons a:hover {
    color: var(--accent-cyan);
    transform: translateY(-5px);
}

/* Animation Classes */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

/* Responsive RTL */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .split-layout {
        flex-direction: column;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .product-gallery {
        justify-content: flex-start;
        /* Allow scroll on mobile */
    }
}