:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --dark: #1a202c;
    --light: #f7fafc;
    --gradient-main: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', sans-serif;
    overflow-x: hidden;
    background: var(--light);
}

/* =================== HERO SECTION =================== */
.hero-premium {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.hero-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.hero-premium::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33%       { transform: translate(30px, -30px) rotate(120deg); }
    66%       { transform: translate(-20px, 20px) rotate(240deg); }
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: rise 10s linear infinite;
}

@keyframes rise {
    0%   { opacity: 0; transform: translateY(100vh) scale(0); }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-100vh) scale(1); }
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    text-align: center;
    padding: 2rem;
    animation: fadeInScale 1s ease;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    letter-spacing: -2px;
    line-height: 1.2;
}

.hero-title span {
    background: linear-gradient(to right, #fff, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    color: rgba(255,255,255,0.95);
    margin-bottom: 2.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 1.2rem 3rem;
    background: white;
    color: var(--primary);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.hero-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.hero-btn:hover::before { left: 100%; }

.hero-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator i {
    font-size: 2rem;
    color: white;
    opacity: 0.8;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(15px); }
}

/* =================== FEATURES / SERVICES SECTION =================== */
.features-section {
    --card-radius: 24px;
    --card-border: #e2e8f0;
    --card-bg: #fff;
    --muted: #718096;

    padding: clamp(64px, 6vw, 110px) 0;
    background: #fff;
    position: relative;
}

.services-section {
    padding: clamp(64px, 6vw, 110px) 0;
    background: #f9fafc;
    position: relative;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: clamp(2.5rem, 5vw, 5rem);
    animation: fadeInUp 0.8s ease;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 0.55rem 1.25rem;
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.15));
    color: var(--primary);
    border: 1px solid rgba(102,126,234,0.18);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(6px);
}

.section-title {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 900;
    margin-bottom: 0.85rem;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    color: #718096;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.8;
}

/* =================== FEATURE CARD =================== */
.feature-card {
    position: relative;
    background: var(--card-bg, #fff);
    border-radius: var(--card-radius, 24px);
    padding: clamp(1.75rem, 2.5vw, 3rem);
    height: 100%;
    border: 1px solid var(--card-border, #e2e8f0);
    overflow: hidden;
    text-align: center;

    transition:
        transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.2),
        box-shadow 0.35s ease,
        border-color 0.35s ease;
    will-change: transform;
}

/* گرادیانت پس‌زمینه در hover */
.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
}

/* نور محیطی گوشه */
.feature-card::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.3), transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
    pointer-events: none;
}

.feature-card:hover { 
    transform: translate3d(0, -12px, 0) scale(1.01);
    box-shadow: 0 22px 70px rgba(102,126,234,0.28);
    border-color: transparent;
}

.feature-card:hover::before { opacity: 1; }
.feature-card:hover::after  { opacity: 1; }

/* متن‌ها در hover — بدون !important روی همه چیز */
.feature-card:hover .feature-title,
.feature-card:hover .feature-text {
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* =================== FEATURE ICON (بهبود اصلی) =================== */
.feature-icon {
    position: relative;
    z-index: 1;

    width: 72px;
    height: 72px;
    margin: 0 auto 1.75rem;

    /* پس‌زمینه گرادیانت با شفافیت ملایم */
    background: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(118,75,162,0.18));
    border: 2px solid rgba(102,126,234,0.2);
    border-radius: 20px;

    display: grid;
    place-items: center;

    /* سایه رنگی ملایم */
    box-shadow:
        0 8px 24px rgba(102,126,234,0.18),
        inset 0 1px 0 rgba(255,255,255,0.6);

    transition:
        background 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.4);
}

/* آیکون داخل باکس */
.feature-icon i {
    font-size: 1.75rem;
    line-height: 1;
    /* رنگ گرادیانت روی آیکون */
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: 
        background 0.35s ease,
        transform 0.35s ease;
    display: block;
}

/* hover کارت: آیکون پس‌زمینه سفید شفاف + آیکون سفید */
.feature-card:hover .feature-icon {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
    box-shadow:
        0 12px 32px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.3);
    transform: translateY(-4px) rotate(8deg) scale(1.08);
}

/* آیکون سفید در hover — override گرادیانت */
.feature-card:hover .feature-icon i {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #fff;
    background-clip: unset;
    color: #fff;
}

.feature-card:focus-within {
    outline: 3px solid rgba(102,126,234,0.35);
    outline-offset: 4px;
}

/* Title / Text */
.feature-title {
    position: relative;
    z-index: 1;
    font-size: clamp(1.15rem, 1.6vw, 1.45rem);
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.85rem;
    transition: color 0.35s ease, text-shadow 0.35s ease;
}

.feature-text {
    position: relative;
    z-index: 1;
    color: #718096;
    line-height: 1.9;
    font-size: 1rem;
    transition: color 0.35s ease, text-shadow 0.35s ease;
}

/* =================== STATS SECTION =================== */
.stats-section {
    padding: 100px 0;
    background: linear-gradient(135deg, rgba(102,126,234,0.03), rgba(118,75,162,0.07));
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(102,126,234,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.stat-card {
    position: relative;
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    margin-bottom: 2rem;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-main);
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(102,126,234,0.2);
}

.stat-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.2rem;
    color: #718096;
    font-weight: 600;
}

/* =================== TEAM SECTION =================== */
.team-section {
    padding: clamp(64px, 6vw, 110px) 0;
    background: #fff;
}

.team-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(102,126,234,0.15);
}

.team-image-wrapper {
    width: 160px;
    height: 160px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    /* اصلاح: --primary به جای --primary-color */
    border: 4px solid var(--primary);
    box-shadow: 0 8px 25px rgba(102,126,234,0.2);
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
    background: #f8f9fa;
}

.team-card:hover .team-image-wrapper {
    border-color: var(--secondary);
    box-shadow: 0 12px 35px rgba(118,75,162,0.3);
}

.team-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
    border-radius: 50%;
}

.team-card:hover .team-image {
    transform: scale(1.05);
}

.team-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.4rem;
}

.team-role {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.team-bio {
    font-size: 0.92rem;
    color: #718096;
    line-height: 1.8;
}

/* =================== SCROLL TO TOP =================== */
/* اصلاح: هم .scroll-top هم .scroll-top-btn پشتیبانی می‌شن */
.scroll-top,
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 52px;
    height: 52px;
    background: var(--gradient-main);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(102,126,234,0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, box-shadow 0.3s;
    z-index: 1000;
}

.scroll-top.visible,
.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover,
.scroll-top-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 40px rgba(102,126,234,0.65);
}

/* =================== ANIMATIONS =================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Card fade-in (کلاس visible از JS اضافه می‌شه) */
.feature-card,
.stat-card,
.team-card {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}

.feature-card.visible,
.stat-card.visible,
.team-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =================== RESPONSIVE =================== */
@media (max-width: 768px) {
    .hero-title    { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .section-title { font-size: 2rem; }
    .stat-number   { font-size: 2.8rem; }

    .feature-icon {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .feature-icon i { font-size: 1.5rem; }
}

/* =================== MOTION SAFETY =================== */
@media (prefers-reduced-motion: reduce) {
    .section-header { animation: none; }

    .feature-card,
    .stat-card,
    .team-card {
        opacity: 1;
        transform: none;
        transition: none !important;
    }

    .feature-card::before,
    .feature-card::after,
    .feature-icon,
    .feature-icon i {
        transition: none !important;
    }

    .feature-card:hover,
    .feature-card:hover .feature-icon {
        transform: none;
    }
}

/* =================== DARK MODE =================== */
@media (prefers-color-scheme: dark) {
    .features-section { background: #0b1220; }
    .services-section { background: #0d1526; }
    .team-section     { background: #0b1220; }

    .feature-card {
        background: rgba(255,255,255,0.04);
        border-color: rgba(226,232,240,0.1);
    }

    .feature-title { color: rgba(226,232,240,0.92); }
    .feature-text  { color: rgba(226,232,240,0.65); }

    .team-card {
        background: rgba(255,255,255,0.04);
        border-color: rgba(226,232,240,0.1);
    }

    .team-name { color: rgba(226,232,240,0.92); }
    .team-bio  { color: rgba(226,232,240,0.65); }

    .stat-card { background: rgba(255,255,255,0.05); }
}
