* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body, html {
    background-color: var(--bg-base);
    color: var(--text-main);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== پس‌زمینه سراسری خطوط مستطیلی و مکعب‌های شیشه‌ای ==================== */
.ice-global-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: 
        radial-gradient(ellipse 85% 55% at 50% 0%, rgba(0, 229, 255, 0.14) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 85% 80%, rgba(0, 119, 255, 0.1) 0%, transparent 70%),
        var(--bg-base);
}

/* شبکه خطوط مستطیلی آبی یخی */
.ice-grid-lines {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(0, 229, 255, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 229, 255, 0.15) 1px, transparent 1px);
    background-size: 90px 52px; /* ابعاد مستطیل‌ها */
    mask-image: radial-gradient(ellipse 92% 82% at 50% 38%, #000 35%, transparent 96%);
    -webkit-mask-image: radial-gradient(ellipse 92% 82% at 50% 38%, #000 35%, transparent 96%);
}

/* مکعب‌ها / مستطیل‌های شیشه‌ای یخی داخل شبکه */
.ice-cubes {
    position: absolute;
    inset: 0;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 40%, transparent 95%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 40%, transparent 95%);
}

.ice-cube {
    position: absolute;
    width: 90px;
    height: 52px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.22) 0%, rgba(168, 245, 255, 0.05) 100%);
    border: 1px solid rgba(168, 245, 255, 0.45);
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.22), inset 0 0 14px rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 3px;
    animation: cubePulse 7s ease-in-out infinite alternate;
}

.c-1 { top: 104px; left: 90px; animation-delay: 0s; }
.c-2 { top: 156px; left: 270px; width: 180px; animation-delay: 1.4s; }
.c-3 { top: 312px; left: 180px; animation-delay: 2.8s; }
.c-4 { top: 468px; left: 90px; width: 180px; animation-delay: 0.9s; }
.c-5 { top: 104px; right: 180px; width: 180px; animation-delay: 2.1s; }
.c-6 { top: 260px; right: 90px; animation-delay: 3.7s; }
.c-7 { top: 416px; right: 270px; width: 180px; animation-delay: 1.8s; }
.c-8 { top: 520px; right: 90px; animation-delay: 4.3s; }

@keyframes cubePulse {
    0% { opacity: 0.12; transform: scale(0.98); }
    50% { opacity: 0.85; transform: scale(1); box-shadow: 0 0 32px rgba(0, 229, 255, 0.4), inset 0 0 18px rgba(255, 255, 255, 0.35); }
    100% { opacity: 0.2; transform: scale(0.99); }
}

/* پرتوهای نوری یخی روی خطوط */
.ice-beam {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), #ffffff, transparent);
    box-shadow: 0 0 12px var(--neon-cyan);
    opacity: 0.8;
}
.beam-1 { top: 156px; left: -300px; width: 260px; height: 2px; animation: beamH 11s linear infinite; }
.beam-2 { top: 364px; right: -300px; width: 280px; height: 2px; animation: beamHRev 14s linear infinite 3s; }
.beam-3 { left: 270px; top: -250px; width: 2px; height: 220px; background: linear-gradient(180deg, transparent, var(--neon-cyan), #ffffff, transparent); animation: beamV 12s linear infinite 1.5s; }
.beam-4 { right: 270px; top: -250px; width: 2px; height: 220px; background: linear-gradient(180deg, transparent, var(--neon-cyan), #ffffff, transparent); animation: beamV 15s linear infinite 4.5s; }

@keyframes beamH { 0% { left: -300px; opacity: 0; } 15%, 85% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes beamHRev { 0% { right: -300px; opacity: 0; } 15%, 85% { opacity: 1; } 100% { right: 100%; opacity: 0; } }
@keyframes beamV { 0% { top: -250px; opacity: 0; } 15%, 85% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

/* ==================== اسکرول‌بار سفارشی ==================== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan), var(--neon-blue));
    border-radius: 99px;
    border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover { background: var(--ice-light); }

::selection { background: rgba(0, 229, 255, 0.3); color: #fff; }

/* ==================== تایپوگرافی و لایه‌بندی ==================== */
svg {
    display: inline-block;
    vertical-align: middle;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

main {
    flex: 1;
    padding: calc(var(--nav-h) + 46px) 20px 60px;
    max-width: var(--maxw);
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

.page-title {
    text-align: center;
    font-size: clamp(2rem, 5.5vw, 3.2rem);
    margin-bottom: 14px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.25;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.page-title .highlight {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.4));
}

.page-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: clamp(0.92rem, 2.5vw, 1.05rem);
    max-width: 560px;
    margin: 0 auto 10px;
    line-height: 1.8;
}

/* ==================== انیمیشن‌ها ==================== */
@keyframes cssFadeUp {
    from { opacity: 0; transform: translateY(42px); filter: blur(6px); }
    to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.fade-up {
    opacity: 0;
    animation: cssFadeUp 0.9s var(--ease-out) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* --- Floating badge / chip --- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: var(--r-pill);
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(168, 245, 255, 0.32);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--ice-light);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.6);
    animation: live-ping 1.8s ease-out infinite;
    flex-shrink: 0;
}
@keyframes live-ping {
    0%   { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(0, 230, 118, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* --- Glowing border card --- */
.glow-border { position: relative; }
.glow-border::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(140deg, rgba(168, 245, 255, 0.7), transparent 45%, rgba(0, 229, 255, 0.5));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.glow-border:hover::after { opacity: 1; }

/* --- Scroll To Top --- */
#scroll-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 900;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--glass-border-hover);
    background: var(--glass-bg-strong);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--neon-cyan);
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.35s var(--ease-out);
    box-shadow: var(--shadow-md);
}
#scroll-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#scroll-top:hover { background: var(--neon-cyan); color: #04121a; transform: translateY(-4px); box-shadow: var(--shadow-cyan); }
#scroll-top svg { width: 20px; height: 20px; }

/* --- Toast --- */
#toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translate(-50%, 90px);
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: var(--r-pill);
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border-hover);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: transform 0.45s var(--ease-bounce), opacity 0.3s ease;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast svg { width: 20px; height: 20px; color: var(--success); flex-shrink: 0; stroke-width: 2.6; }

.section { margin-top: 90px; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; margin-bottom: 12px; letter-spacing: -0.5px; }
.section-head p { color: var(--text-muted); line-height: 1.8; max-width: 520px; margin: 0 auto; font-size: 0.98rem; }

/* --- شمارنده آمار --- */
.stat-num {
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    color: var(--ice-light);
    text-shadow: 0 0 25px rgba(0, 229, 255, 0.55);
    direction: ltr;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.stat-label {
    color: var(--text-muted);
    font-size: clamp(0.72rem, 2vw, 0.88rem);
    text-align: center;
}

/* --- Reveal on scroll --- */
.reveal {
    opacity: 0;
    transform: translateY(38px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), filter 0.8s ease;
    filter: blur(5px);
    will-change: opacity, transform;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

@media (max-width: 600px) {
    .ice-grid-lines { background-size: 60px 40px; }
    .ice-cube { width: 60px; height: 40px; }
    .c-2, .c-4, .c-5, .c-7 { width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .fade-up, .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
}