@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb.woff2') format('woff2'),
         url('../fonts/IRANSansWeb.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #14b8a6;
    --accent2: #f59e0b;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.12);
    --gradient: linear-gradient(135deg, #14b8a6, #f59e0b);
}

/* ========== پایه ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IRANSans', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color .3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

::selection {
    background: var(--accent);
    color: #fff;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== پیش‌لودر ========== */
#preloader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .5s, visibility .5s;
}
#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== هدر ========== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}
.brand {
    display: flex;
    align-items: center;
}
.brand .logo {
    height: 60px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: transform .3s ease;
}
.brand:hover .logo {
    transform: scale(1.03);
}
.main-nav ul {
    display: flex;
    gap: 30px;
    list-style: none;
}
.main-nav a {
    font-weight: 500;
    color: var(--text);
    position: relative;
    padding: 5px 0;
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width .3s;
    border-radius: 2px;
}
.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}
.main-nav a:hover {
    color: var(--accent);
}
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 5px;
}
.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: .3s;
}

/* ========== هیرو ========== */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(20,184,166,0.15) 0%, transparent 50%);
    animation: heroBg 12s ease-in-out infinite alternate;
}
@keyframes heroBg {
    0% { transform: translate(0,0); }
    100% { transform: translate(5%, 5%); }
}
.hero-inner {
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
    z-index: 1;
}
.hero-text {
    flex: 1;
}
.hero-badge {
    display: inline-block;
    background: rgba(20,184,166,0.2);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(20,184,166,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(20,184,166,0); }
}
.hero h1 {
    font-size: 2.8rem;
    line-height: 1.3;
    margin-bottom: 20px;
}
.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.typewriter {
    color: var(--accent2);
    border-left: 2px solid var(--accent2);
    padding-left: 5px;
}
.hero-desc {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 30px;
    max-width: 600px;
}
.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 500;
    transition: transform .3s, box-shadow .3s, background .3s;
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.btn-primary {
    background: var(--gradient);
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #0ea892, #e08e00);
    box-shadow: 0 10px 25px rgba(20,184,166,0.4);
}
.btn-outline {
    border: 2px solid #fff;
    color: #fff;
}
.btn-outline:hover {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 10px 25px rgba(255,255,255,0.2);
}
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}
.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(20,184,166,0.4), transparent 70%);
    border-radius: 50%;
    animation: blob 8s infinite alternate;
}
.hero-logo {
    width: 280px;
    position: relative;
    z-index: 1;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(20,184,166,0.3));
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
@keyframes blob {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* ========== بخش مقالات ========== */
.posts-section {
    padding: 80px 0;
}
.section-header {
    text-align: center;
    margin-bottom: 50px;
}
.section-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}
.section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--gradient);
    margin: 10px auto 0;
    border-radius: 3px;
}
.section-header p {
    color: var(--muted);
}
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}
.post-card {
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .3s, box-shadow .3s;
    position: relative;
}
.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity .3s;
}
.post-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}
.post-card:hover::before {
    opacity: 1;
}
.post-thumb {
    display: block;
    overflow: hidden;
}
.post-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform .5s;
}
.post-card:hover .post-thumb img {
    transform: scale(1.05);
}
.post-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: linear-gradient(135deg, #e0f2fe, #f0fdfa);
    font-size: 48px;
    color: var(--accent);
}
.post-card-body {
    padding: 20px;
}
.post-date {
    color: var(--muted);
    font-size: 14px;
}
.post-card h3 {
    margin: 10px 0;
    font-size: 1.3rem;
}
.post-card h3 a:hover {
    color: var(--accent);
}
.post-card p {
    color: var(--muted);
}
.read-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--accent);
    font-weight: 500;
}
.read-more:hover {
    color: var(--accent2);
}
.read-more .arrow {
    display: inline-block;
    margin-right: 5px;
    transition: transform .3s;
}
.read-more:hover .arrow {
    transform: translateX(-5px);
}
.empty {
    text-align: center;
    color: var(--muted);
    grid-column: 1/-1;
}
.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    grid-column: 1/-1;
}
.empty-state .empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}
.empty-state h3 {
    margin-bottom: 10px;
}
.empty-state p {
    color: var(--muted);
}
.section-footer {
    text-align: center;
    margin-top: 40px;
}

/* ========== سربرگ صفحات ========== */
.page-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 70% 30%, rgba(20,184,166,0.15) 0%, transparent 50%);
}
.page-header h1 {
    font-size: 2.5rem;
    position: relative;
}
.page-header p {
    color: #cbd5e1;
    position: relative;
}

/* ========== محتوای صفحه ========== */
.page-content {
    padding: 60px 20px;
}
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.about-image img {
    border-radius: 16px;
    box-shadow: var(--shadow);
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}
.service-card {
    background: var(--card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: transform .3s, box-shadow .3s;
    position: relative;
    overflow: hidden;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: rgba(20,184,166,0.08);
    border-radius: 0 16px 0 80px;
}
.service-card h3 {
    color: var(--accent);
    margin-bottom: 10px;
}
.contact-info ul {
    list-style: none;
    margin: 20px 0;
}
.contact-info li {
    margin-bottom: 10px;
}

/* ========== مقاله تکی ========== */
.single-post {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
}
.single-post-header {
    text-align: center;
    margin-bottom: 40px;
}
.single-post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}
.single-post-header h1 {
    font-size: 2.2rem;
}
.post-meta {
    color: var(--muted);
    margin-top: 10px;
}
.tags {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}
.tag {
    background: var(--accent);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
}
.single-post-content {
    line-height: 2;
}
.single-post-content h2 {
    margin: 30px 0 15px;
    color: var(--primary);
}
.single-post-content p {
    margin-bottom: 20px;
}
.single-post-content blockquote {
    border-right: 4px solid var(--accent);
    padding: 10px 20px;
    background: #f1f5f9;
    border-radius: 8px;
    margin: 20px 0;
}

/* ========== فوتر ========== */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 60px 0 0;
}
.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-brand .footer-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    margin-bottom: 15px;
}
.footer-brand p {
    color: #94a3b8;
}
.footer-links h4,
.footer-contact h4,
.footer-social h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.1rem;
}
.footer-links ul {
    list-style: none;
}
.footer-links li {
    margin-bottom: 8px;
}
.footer-links a:hover {
    color: var(--accent);
}
.social-icons {
    display: flex;
    gap: 10px;
}
.social-icons a {
    background: #1e293b;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
}
.social-icons a:hover {
    background: var(--accent);
    color: #fff;
}
.footer-contact .contact-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.footer-contact .contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #1e293b;
    color: #e2e8f0;
    transition: all .3s ease;
}
.footer-contact .contact-link:hover {
    background: var(--accent);
    color: #fff;
    transform: translateX(-5px);
}
.footer-contact .contact-link svg {
    flex-shrink: 0;
}
.footer-contact .phone-link {
    direction: ltr;
    font-weight: 500;
}
.footer-contact .telegram-link {
    color: #e2e8f0;
}
.footer-bottom {
    border-top: 1px solid #1e293b;
    text-align: center;
    padding: 20px 0;
    font-size: 14px;
}

/* ========== انیمیشن ظهور ========== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s ease, transform .8s ease;
}
.reveal.visible {
    opacity: 1;
    transform: none;
}

.error-page {
    text-align: center;
    padding: 100px 20px;
}
.error-page h1 {
    font-size: 4rem;
    color: var(--accent);
}

/* ========== ریسپانسیو ========== */
@media (max-width: 900px) {
    .hero-inner {
        flex-direction: column;
        text-align: center;
    }
    .hero-visual {
        order: -1;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 80px;
        right: 0;
        left: 0;
        background: #fff;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        transform: translateY(-150%);
        transition: transform .3s;
    }
    .main-nav.open {
        transform: translateY(0);
    }
    .main-nav ul {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    .menu-toggle {
        display: flex;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .posts-grid {
        grid-template-columns: 1fr;
    }
    .footer-contact .contact-link {
        width: 100%;
        justify-content: center;
    }
}