/* ============================================================
   HOME PAGE STYLES v2 — AvalServer
   فقط از متغیرهای موجود در variables.css استفاده شده (رنگ جدید نداریم)
   ریتم صفحه: hero تیره ← کارت ویژگی‌ها ← محصولات روشن ← «چرا ما» تیره ← آمار ← خدمات روشن
   ============================================================ */

:root {
    --home-ease: cubic-bezier(0.2, 0.6, 0.2, 1);
    --home-y: clamp(3.5rem, 7vw, 6rem);
}

/* ==================== HERO (dark) ==================== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(5rem, 9vw, 7rem);
    background-color: var(--color-primary-navy);
    background-image: var(--gradient-navy, none);
    color: var(--color-white);
}

/* شبکهٔ ظریف زیرساخت */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 80% 90% at 30% 40%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 90% at 30% 40%, #000 30%, transparent 75%);
}

.hero::after {
    content: '';
    position: absolute;
    top: -25%;
    left: -8%;
    width: 640px;
    height: 640px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(22, 139, 255, 0.28), transparent 70%);
}

.hero .hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1400px;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    align-items: center;
    gap: clamp(1.5rem, 3vw, 3rem);
}

.hero-content {
    max-width: 560px;
    text-align: start;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-sky-blue);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.6;
}

/* نشانگر وضعیت آنلاین */
.hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-electric-blue);
    box-shadow: 0 0 0 0 rgba(22, 139, 255, 0.6);
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    font-size: clamp(2rem, 1.2rem + 2.8vw, 3.4rem);
    font-weight: 900;
    line-height: 1.3;
    text-wrap: balance;
}

.hero-title-line1 {
    display: block;
    color: var(--color-white);
}

.hero-title-line2 {
    display: block;
    background: linear-gradient(135deg, #D4A23A 0%, #E8C66A 50%, #D4A23A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    max-width: 50ch;
    margin-bottom: 2rem;
    color: var(--color-sky-blue);
    opacity: 0.85;
    font-size: 1.05rem;
    line-height: 2;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.875rem;
}

.hero-actions .btn {
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
}

.hero-actions .btn-outline {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    color: var(--color-white);
}

.hero-actions .btn-outline:hover {
    background: var(--color-white);
    border-color: var(--color-white);
    color: var(--color-primary-navy);
}

/* تصویر سرور با درخشش پشتش */
.hero .hero-image--stage {
    position: relative;
    display: block;
    width: 100%;
    max-width: none;
}

.hero .hero-image--stage::before {
    content: '';
    position: absolute;
    inset: 10% 5%;
    background: radial-gradient(circle, rgba(22, 139, 255, 0.25), transparent 65%);
    pointer-events: none;
}

.hero .hero-stage,
.hero .hs-svg {
    position: relative;
    width: 100%;
    height: auto;
}

.hero .hs-svg {
    max-height: min(600px, 72vh);
}

@media (prefers-reduced-motion: no-preference) {
    .hero-content {
        animation: home-rise 0.7s var(--home-ease) both;
    }

    .hero-badge::before {
        animation: home-pulse 2.4s ease-out infinite;
    }

    @keyframes home-rise {
        from { opacity: 0; transform: translateY(14px); }
        to   { opacity: 1; transform: none; }
    }

    @keyframes home-pulse {
        0%   { box-shadow: 0 0 0 0 rgba(22, 139, 255, 0.6); }
        70%  { box-shadow: 0 0 0 10px rgba(22, 139, 255, 0); }
        100% { box-shadow: 0 0 0 0 rgba(22, 139, 255, 0); }
    }
}

/* ==================== FEATURES BAR (floating card) ==================== */
.features-bar {
    position: relative;
    z-index: 2;
    padding: 0;
    background: transparent;
    border: 0;
}

.features-bar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: calc(-1 * clamp(2.5rem, 4.5vw, 3.25rem));
    padding: 0.5rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.feature-bar-item {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.875rem;
    align-items: center;
    padding: 1rem 1.25rem;
    text-align: start;
}

.feature-bar-item:not(:last-child)::after {
    content: '';
    position: absolute;
    inset-inline-end: 0;
    top: 22%;
    bottom: 22%;
    width: 1px;
    background: var(--color-border);
}

.feature-bar-icon {
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--color-sky-blue);
    color: var(--color-royal-blue);
}

.feature-bar-icon svg {
    width: 26px;
    height: 26px;
    stroke-width: 1.75;
}

.feature-bar-item h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--color-primary-navy);
}

.feature-bar-item p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

/* ==================== WHY US (dark) ==================== */
.whyus-section {
    padding: var(--home-y) 0;
    background-color: var(--color-primary-navy);
    background-image: var(--gradient-navy, none);
}

.whyus-inner {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

.whyus-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.whyus-image img {
    width: 100%;
    max-width: 500px;
}

.whyus-animation {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    min-height: 400px;
    border: none;
    background: transparent;
    overflow: hidden;
}

.whyus-content .section-title {
    margin-bottom: 0.5rem;
    text-align: start;
    color: var(--color-white);
    text-wrap: balance;
}

.whyus-content .section-description {
    max-width: 58ch;
    margin-bottom: 2rem;
    color: var(--color-sky-blue);
    opacity: 0.85;
}

.whyus-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.whyus-item {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    transition: border-color 0.25s var(--home-ease), background-color 0.25s var(--home-ease);
}

.whyus-item:hover {
    border-color: var(--color-champagne-gold);
    background: rgba(255, 255, 255, 0.07);
}

.whyus-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 0.875rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-champagne-gold);
    font-size: 1.4rem;
    line-height: 1;
}

.whyus-icon svg {
    width: 24px;
    height: 24px;
}

.whyus-item h4 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
    color: var(--color-white);
}

.whyus-item p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.8;
    color: var(--color-sky-blue);
    opacity: 0.8;
}

/* ==================== STATS ==================== */
.stats-bar {
    padding: clamp(2.5rem, 5vw, 3.75rem) 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
}

.stat-item {
    position: relative;
    padding: 0.5rem 1rem;
}

.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    inset-inline-end: 0;
    top: 15%;
    bottom: 15%;
    width: 1px;
    background: var(--color-border);
}

.stat-number {
    margin-bottom: 0.25rem;
    font-size: clamp(2.25rem, 1.6rem + 2vw, 3.25rem);
    font-weight: 900;
    line-height: 1.3;
    background: linear-gradient(135deg, #D4A23A 0%, #E8C66A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ==================== SERVICES ==================== */
.services-section {
    padding: var(--home-y) 0;
}

.services-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

.services-content .section-title {
    margin-bottom: 0.5rem;
    text-align: start;
    text-wrap: balance;
}

.services-content .section-description {
    max-width: 58ch;
    margin-bottom: 2rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.service-item {
    padding: 1.125rem 1.25rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-inline-start: 3px solid var(--color-champagne-gold);
    border-radius: 14px;
    transition: box-shadow 0.25s var(--home-ease);
}

.service-item:hover {
    box-shadow: var(--shadow-md);
}

.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
    border-radius: 10px;
    background: var(--color-sky-blue);
    color: var(--color-royal-blue);
    font-size: 1.25rem;
    line-height: 1;
}

.service-icon svg {
    width: 22px;
    height: 22px;
}

.service-item h4 {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
}

.service-item p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.services-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.services-image img {
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: -14px 14px 0 0 var(--color-sky-blue), var(--shadow-lg);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    .hero .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        margin-inline: auto;
        text-align: center;
    }

    .hero-title { align-items: center; }
    .hero-description { margin-inline: auto; }
    .hero-actions { justify-content: center; }
    .hero .hs-svg { max-height: none; }

    .features-bar-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-bar-item:nth-child(2)::after { display: none; }

    .feature-bar-item:nth-child(-n + 2) {
        border-bottom: 1px solid var(--color-border);
    }

    .whyus-inner,
    .services-inner { grid-template-columns: 1fr; }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-item::after { display: none; }

    .stat-item:not(:last-child) {
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--color-border);
    }
}

@media (max-width: 640px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .hero-actions .btn { width: 100%; }

    .features-bar-grid { grid-template-columns: 1fr; }
    .feature-bar-item::after { display: none !important; }
    .feature-bar-item:not(:last-child) { border-bottom: 1px solid var(--color-border); }

    .whyus-grid,
    .services-grid { grid-template-columns: 1fr; }

    .whyus-animation { min-height: 300px; }

    .services-image img { box-shadow: var(--shadow-lg); }
}