
    /* --- CSS Variables & Modern Palette --- */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #06b6d4;
    --accent: #8b5cf6;
    --success: #10b981;

    /* Light Mode Surface Colors */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f1f5f9;

    /* Typography */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* Effects */
    --gradient-main: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --border-subtle: rgba(0,0,0,0.06);

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}


/* ========================================== */
/* CRITICAL MOBILE OVERFLOW FIX               */
/* ========================================== */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Ensure the main wrapper doesn't let child elements break the layout */
main, .main-wrapper {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Fix for any sliders pushing past screen bounds */
.container {
    max-width: 100%;
    overflow-x: visible; /* Allows sliders to peek, but contained by body */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.8; /* Increased for better Persian readability */
    overflow-x: hidden;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 40px 40px;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Global Animations --- */
@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Header ===== */
header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 1000;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 10px 30px;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    transition: border-radius 0.3s ease, box-shadow 0.3s ease;
}
header.menu-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: var(--shadow-lg);
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    height: 42px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logo-content {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

/* ===== Ultra-Premium Section Header ===== */
.section-header-pro {
    position: relative;
    text-align: center;
    padding: 60px 0 80px;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* 1. Animated Color Mesh Background (Glowing Orbs) */
.section-header-pro::before,
.section-header-pro::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    z-index: -1;
    opacity: 0.35;
    animation: floatGlow 8s infinite alternate ease-in-out;
}
.section-header-pro::before {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: 0;
    right: 20%;
}
.section-header-pro::after {
    width: 250px;
    height: 250px;
    background: var(--accent);
    bottom: 20px;
    left: 20%;
    animation-delay: -4s;
}

@keyframes floatGlow {
    0% { transform: translateY(0px) scale(1) rotate(0deg); opacity: 0.2; }
    100% { transform: translateY(40px) scale(1.3) rotate(20deg); opacity: 0.5; }
}

/* 2. Elevated Floating Badge */
.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 24px; /* RTL padding */
    background: white;
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 100px;
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.15);
    margin-bottom: 35px;
    backdrop-filter: blur(10px);
}
.pro-badge .icon-box {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.pro-badge span {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

/* 3. The Main Typography */
.pro-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 35px;
    position: relative;
}

/* Giant Watermark Text behind the title */
.pro-title::before {
    content: 'SERVICES'; /* You can change this text */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 2px rgba(0,0,0,0.03);
    white-space: nowrap;
    z-index: -1;
    pointer-events: none;
    letter-spacing: 15px;
    text-transform: uppercase;
}

/* Continuously flowing multi-color gradient */
.pro-title .animated-gradient {
    background: linear-gradient(
            to right,
            var(--primary) 0%,
            var(--secondary) 25%,
            var(--accent) 50%,
            var(--primary) 75%,
            var(--secondary) 100%
    );
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientMove 4s linear infinite;
    display: inline-block;
    padding-bottom: 10px;
}

@keyframes gradientMove {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* 4. Glassmorphic Description Box */
.pro-desc {
    max-width: 650px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.9);
    padding: 25px 35px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04);
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.9;
    position: relative;
}

/* Floating decorative icon overlapping the box */
.pro-desc .desc-icon {
    position: absolute;
    top: -20px;
    right: -20px;
    background: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.2rem;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(0,0,0,0.02);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .pro-title { font-size: 2.2rem; }
    .pro-title::before { font-size: 4rem; letter-spacing: 5px; }
    .pro-desc { padding: 20px; font-size: 0.95rem; margin: 0 15px; }
    .section-header-pro::before, .section-header-pro::after { filter: blur(40px); }
}


.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.logo {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.logo span { color: var(--primary); }

/* ===== Nav Links ===== */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1px;
    list-style: none;
}
.nav-links > li > a {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 8px 11px;
    border-radius: 20px;
    transition: 0.25s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    cursor: pointer;
}
.nav-links > li > a:hover,
.nav-links > li > a.active {
    background: var(--bg-surface-alt);
    color: var(--primary);
}
.nav-links > li > a.nav-special {
    color: var(--primary);
    font-weight: 700;
}
.nav-arrow {
    font-size: 0.58rem;
    transition: transform 0.3s;
    margin-top: 1px;
}
.has-mega:hover .nav-arrow,
.has-dropdown:hover .nav-arrow,
.has-mega.mobile-open > a .nav-arrow,
.has-dropdown.mobile-open > a .nav-arrow {
    transform: rotate(180deg);
}

/* ===== CTA Button ===== */
.cta-btn {
    background: var(--text-main);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.83rem;
    transition: 0.3s;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    flex-shrink: 0;
}
.cta-btn:hover {
    transform: translateY(-2px);
    background: var(--primary);
    box-shadow: var(--shadow-lg);
}

/* ===== Mega Menu (خدمات) ===== */
.has-mega { position: static; }
.mega-menu {
    position: absolute;
    top: calc(100% + 0px);
    right: 0;
    left: 0;
    background: white;
    border-radius: 0 0 28px 28px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border: 1px solid var(--border-subtle);
    border-top: none;
    padding: 30px 30px 25px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 997;
    pointer-events: none;
}
.mega-menu::before {
    content: '';
    position: absolute;
    top: -18px;
    left: 0;
    right: 0;
    height: 18px;
    background: transparent;
}
.has-mega:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.mega-inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}
.mega-col-title {
    font-weight: 800;
    font-size: 0.79rem;
    color: var(--text-main);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-surface-alt);
    display: flex;
    align-items: center;
    gap: 8px;
}
.mega-col-title i {
    color: var(--primary);
    background: rgba(59,130,246,0.08);
    padding: 5px 6px;
    border-radius: 8px;
    font-size: 0.8rem;
}
.mega-col ul { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.mega-col ul li a {
    font-size: 0.83rem;
    color: var(--text-muted);
    display: block;
    padding: 5px 8px;
    border-radius: 8px;
    transition: 0.2s;
}
.mega-col ul li a:hover {
    background: var(--bg-surface-alt);
    color: var(--primary);
    padding-right: 14px;
}

/* ===== Simple Dropdown (محصولات) ===== */
.has-dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    min-width: 260px;
    background: white;
    border-radius: 18px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-subtle);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 998;
    pointer-events: none;
}
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -18px;
    left: 0;
    right: 0;
    height: 18px;
    background: transparent;
}
.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.drop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    transition: 0.2s;
    color: var(--text-main);
}
.drop-item:hover { background: var(--bg-surface-alt); }
.drop-icon {
    width: 38px;
    height: 38px;
    background: rgba(59,130,246,0.07);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
    font-size: 1rem;
    transition: 0.2s;
}
.drop-item:hover .drop-icon { background: var(--primary); color: white; }
.drop-title { font-weight: 700; font-size: 0.88rem; }
.drop-sub { font-size: 0.74rem; color: var(--text-light); margin-top: 2px; }

/* ===== Mobile Toggle ===== */
.mobile-toggle {
    display: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-main);
    padding: 4px 8px;
    order: 3;
}

/* ===== Responsive ===== */
@media (max-width: 1150px) {
    header { padding: 10px 20px; }
    .nav-links > li > a { padding: 7px 8px; font-size: 0.8rem; }
    .cta-btn { padding: 9px 14px; font-size: 0.78rem; }
}
@media (max-width: 1024px) {
    .mobile-toggle { display: block; }
    .cta-btn { display: none; }
    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 2px);
        right: 0;
        left: 0;
        background: white;
        border-radius: 0 0 24px 24px;
        box-shadow: var(--shadow-xl);
        border: 1px solid var(--border-subtle);
        border-top: none;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 3px;
        max-height: 72vh;
        overflow-y: auto;
    }
    .nav-links.open { display: flex; }
    .nav-links > li > a { padding: 11px 15px; font-size: 0.9rem; border-radius: 12px; }
    /* Mobile mega/dropdown panels */
    .mega-menu, .dropdown-menu {
        position: static;
        opacity: 1 !important;
        visibility: hidden;
        height: 0;
        overflow: hidden;
        transform: none !important;
        box-shadow: none;
        border: none;
        padding: 0;
        pointer-events: none;
        border-radius: 12px;
        background: var(--bg-surface-alt);
        margin-top: 4px;
        transition: height 0.3s ease, padding 0.3s ease, visibility 0.3s;
    }
    .has-mega.mobile-open > .mega-menu,
    .has-dropdown.mobile-open > .dropdown-menu {
        visibility: visible;
        height: auto;
        padding: 15px;
        pointer-events: auto;
    }
    .mega-inner { grid-template-columns: 1fr 1fr; gap: 15px; }
    .has-mega, .has-dropdown { position: relative; }
}
@media (max-width: 600px) {
    .mega-inner { grid-template-columns: 1fr; }
    header { width: 95%; }
}

/* --- Hero Section --- */
.hero {
    padding: 180px 0 100px;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
    animation: blob 10s infinite;
}
.blob-1 { background: var(--primary); top: -10%; right: -10%; animation-delay: 0s; }
.blob-2 { background: var(--secondary); bottom: -10%; left: -10%; animation-delay: 2s; }
.blob-3 { background: var(--accent); top: 40%; left: 40%; width: 300px; height: 300px; animation-delay: 4s; opacity: 0.3; }

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.3;
    margin-bottom: 25px;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--text-main);
}

.hero-text .gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 35px;
    max-width: 600px;
    line-height: 2;
    text-align: justify;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn-outline {
    background: white;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.btn-outline:hover {
    border-color: var(--text-main);
}

/* Hero Dashboard Mockup */
.hero-visual {
    perspective: 1500px;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid white;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    transform: rotateY(-10deg) rotateX(5deg);
    transition: transform 0.5s ease;
    position: relative;
    overflow: hidden;
}

.hero-visual:hover .dashboard-card {
    transform: rotateY(0) rotateX(0);
}

.dash-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
}
.dash-dots { display: flex; gap: 6px; }
.dash-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Login Input Focus Styles */
.dash-input:focus {
    border-color: var(--primary) !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Project Widget Styles */
.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.project-item {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
}

.project-item:hover, .project-item.selected {
    background: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-item i {
    font-size: 1.5rem;
    color: var(--text-light);
    transition: 0.3s;
}

.project-item:hover i, .project-item.selected i {
    color: var(--primary);
}

.project-item span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* --- Tech Marquee --- */
.marquee-section {
    padding: 40px 0;
    background: white;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
    white-space: nowrap;
}

.marquee-container {
    display: inline-block;
    animation: marquee 30s linear infinite;
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 40px;
    font-weight: 700;
    color: var(--text-light);
    font-size: 1.2rem;
    opacity: 0.7;
}
.marquee-item i { font-size: 1.5rem; color: var(--text-muted); }

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

/* ===== Video/GIF Service Cards ===== */

/* Add this inside your max-width: 600px media query */
.vid-card.mobile-active .vid-content p {
    max-height: 150px;
    opacity: 1;
    transform: translateY(0);
}


/* Placeholder Image */
.vid-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2; /* Sits above the video */
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1.02);
}

.services {
    padding: 120px 0;
    background: var(--bg-body);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.vid-card {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    height: 450px;
    background: var(--bg-surface-alt);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.vid-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}

/* The media container (video or GIF) */
.vid-media video {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Ensure the designer's media fills the box perfectly */
.vid-media video,
.vid-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1.02); /* Slight scale to prevent border gaps */
}

.vid-card:hover .vid-poster {
    opacity: 0;
}
/* Fade out the placeholder on hover (Desktop) OR when in view (Mobile) */
.vid-card:hover .vid-poster,
.vid-card.mobile-active .vid-poster {
    opacity: 0;
}
.vid-card:hover .vid-media video,
.vid-card:hover .vid-media img {
    transform: scale(1.08);
}

/* Gradient overlay so the white text is readable */
.vid-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.5) 50%, transparent 100%);
    z-index: 2;
    transition: height 0.4s ease;
}

.vid-card:hover .vid-overlay {
    height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.7) 100%);
}

/* The text content */
.vid-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 35px 30px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.vid-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 20px;
    transition: 0.3s;
}

.vid-card:hover .vid-icon {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.vid-content h3 {
    color: white;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.vid-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.8;
    max-height: 0; /* Hidden by default */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.vid-card:hover .vid-content p {
    max-height: 150px; /* Expands on hover */
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); }
    .vid-card { height: 400px; }
}

@media (max-width: 600px) {
    .video-grid { grid-template-columns: 1fr; }
    .vid-content p {
        max-height: none;
        opacity: 1;
        transform: translateY(0);
    }
    .vid-overlay { height: 100%; background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.4) 100%); }
}

/* Fix double-tap issue on mobile links with hover states */
.card-link {
    display: block;
    -webkit-tap-highlight-color: transparent;
}
/* Disable hover effects completely on touch devices to ensure 1-tap clicks */
@media (hover: none) {
    .vid-card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
}

/* --- Detailed Workflow --- */
.workflow { padding: 120px 0; background: var(--bg-surface-alt); position: relative; }

.workflow-steps {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.workflow-line {
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    border-left: 2px dashed #cbd5e1;
    transform: translateX(-50%);
    z-index: 0;
}

.step-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 100px;
    position: relative;
    z-index: 1;
}

.step-item:last-child { margin-bottom: 0; }
.step-item:nth-child(even) { flex-direction: row-reverse; }

.step-content { width: 45%; }
.step-visual { width: 45%; display: flex; justify-content: center; }

/* New GIF Styles */
.step-gif {
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 4px solid white;
    transition: 0.3s;
}

.step-item:hover .step-gif {
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

.step-number {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 50px; height: 50px;
    background: white;
    border: 4px solid var(--bg-surface-alt);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900;
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.step-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
}

/* --- Products --- */
.products { padding: 120px 0; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 24px;
    padding: 10px;
    border: 1px solid var(--border-subtle);
    transition: 0.3s;
}

.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-xl); }

.product-image {
    height: 180px;
    background: var(--bg-surface-alt);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image i { font-size: 4rem; color: #cbd5e1; transition: 0.3s; }
.product-card:hover .product-image i { transform: scale(1.1); color: var(--secondary); }

.product-info { padding: 25px 15px 15px; }
.product-tag { font-size: 0.75rem; color: var(--primary); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; display: block; margin-bottom: 8px; }
.product-info h3 { font-size: 1.3rem; margin-bottom: 10px; }
.product-info p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

.btn-link { color: var(--text-main); font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 5px; }
.btn-link:hover { gap: 10px; color: var(--primary); }

/* --- Portfolio & Testimonials (Added Sections) --- */
.portfolio { padding: 120px 0; background: white; }
.portfolio-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}
.portfolio-item {
    padding: 15px 30px;
    background: var(--bg-surface-alt);
    border-radius: 50px;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    transition: 0.3s;
}
.portfolio-item:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.testimonials { padding: 120px 0; background: var(--bg-surface-alt); }
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.testimonial-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.testimonial-card i { font-size: 2rem; color: var(--border-subtle); margin-bottom: 20px; }

/* --- Articles --- */
.articles { padding: 120px 0; }
.article-card {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    overflow: hidden;
    transition: 0.3s;
}
.article-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-5px); }
.article-content { padding: 25px; }

/* --- Footer --- */
footer {
    background: #0f172a;
    color: white;
    padding: 80px 0 30px;
    margin-top: 100px;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-buttons { justify-content: center; }
    .hero-visual { display: none; }
    .workflow-line { left: 20px; border-left-style: solid; }
    .step-item { flex-direction: column; align-items: flex-start; margin-left: 50px; }
    .step-item:nth-child(even) { flex-direction: column; }
    .step-content, .step-visual { width: 100%; margin-bottom: 20px; }
    .step-number { left: -30px; top: 0; transform: none; }
    header { width: 95%; padding: 10px 20px; }
    .nav-links { display: none; }
    .mobile-toggle { display: block; }
}

@media (max-width: 600px) {
    .bento-grid { grid-template-columns: 1fr; }
    .hero-text h1 { font-size: 2.2rem; }
}
