/* ===== منبع واحد: هدر، فوتر، منوی همبرگر، فونت، رنگ، پس‌زمینه، z-index برای همه ابزارها ===== */

:root {
    --primary: #22c55e;
    --primary-dim: rgba(34, 197, 94, 0.15);
    --bg: #0f0f0f;
    --bg-card: #1a1a1a;
    --border: rgba(255, 255, 255, 0.08);
    --text: #fafafa;
    --text-muted: #737373;
    --header-h: 56px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --section-gap: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    width: auto;
    height: auto;
    padding: 10px 14px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--primary);
    color: #0a0a0a;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

html {
    background: #0a0a0a;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(160deg, #0a0a0a 0%, #0f0f0f 35%, #0c0c0c 70%, #080808 100%);
    background-attachment: fixed;
    background-color: #0a0a0a;
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0));
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    overflow-y: visible;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 15, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-top: max(10px, env(safe-area-inset-top));
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.logo-link img {
    height: 32px;
    width: auto;
    display: block;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

.nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.25s, opacity 0.25s;
    margin: 0 auto;
}

.site-header.nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header.nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.site-header.nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-overlay { display: none; }

.nav-drawer-logo {
    display: none;
}

.nav-drawer-cta {
    display: none;
}

.nav-wrap {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    text-align: left;
}

.nav-menu a:hover {
    color: var(--primary);
    background: var(--primary-dim);
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-drawer-logo {
        display: block;
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }
    .nav-drawer-logo-link {
        display: inline-block;
        text-decoration: none;
        color: inherit;
        line-height: 0;
    }
    .nav-drawer-logo-link img {
        height: 32px;
        width: auto;
        max-width: none;
        display: block;
        object-fit: contain;
        object-position: left center;
    }
    .nav-drawer-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-top: auto;
        padding: 14px 20px;
        background: var(--primary);
        color: #0a0a0a;
        font-size: 15px;
        font-weight: 600;
        text-decoration: none;
        border-radius: 10px;
        border: none;
        transition: background 0.2s;
        flex-shrink: 0;
    }
    .nav-drawer-cta:hover {
        background: #1ea34e;
        color: #0a0a0a;
    }
    .nav-wrap .nav-drawer-cta {
        margin-top: 20px;
    }
    .nav-wrap {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(300px, 88vw);
        max-width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        background: #0a0a0a;
        border-right: 1px solid var(--border);
        padding: calc(var(--header-h) + 2px) 24px max(24px, env(safe-area-inset-bottom));
        padding-top: max(calc(var(--header-h) + 2px), env(safe-area-inset-top));
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
        visibility: hidden;
        z-index: 1001;
        pointer-events: none;
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .site-header.nav-open .nav-wrap {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }
    .nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: 100vh;
        min-height: 100dvh;
        background: rgba(0, 0, 0, 0.7);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s;
        z-index: 1000;
        cursor: pointer;
    }
    .site-header.nav-open .nav-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .nav-menu {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        text-align: left;
        flex: 1;
    }
    .nav-menu a {
        padding: 14px 18px;
        min-height: 48px;
        font-size: 16px;
        border-radius: 10px;
        text-align: left;
        justify-content: flex-start;
    }
    .nav-item--desktop-only { display: none !important; }
}

@media (min-width: 769px) {
    .nav-wrap { opacity: 1; visibility: visible; }
    .nav-item--drawer-only { display: none !important; }
}

.main-wrap {
    position: relative;
    z-index: 0;
    min-height: calc(100vh - var(--header-h) - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 24px;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: 24px;
    padding-left: max(20px, env(safe-area-inset-left));
}

@media (max-width: 768px) {
    .main-wrap {
        padding-top: 20px;
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: 20px;
        padding-left: max(20px, env(safe-area-inset-left));
    }
}

@media (max-width: 480px) {
    .main-wrap {
        padding-top: 20px;
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: 20px;
        padding-left: max(16px, env(safe-area-inset-left));
    }
}

.site-footer {
    border-top: 1px solid var(--border);
    background: #0a0a0a;
    padding-top: 28px;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    margin-top: var(--section-gap);
}

.footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    text-align: left;
    background: transparent;
}

.footer-brand {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.footer-brand:hover { color: var(--primary); }

.footer-tagline {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 24px;
}

.footer-sections {
    display: grid;
    gap: 24px 32px;
    margin-bottom: 28px;
    text-align: left;
}

.footer-sections--cols-3 {
    grid-template-columns: 1.25fr 1fr 1fr;
}

.footer-sections--cols-4 {
    grid-template-columns: 1.25fr 1fr 1fr 1fr;
}

.footer-card {
    padding: 0;
}

.footer-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px;
    padding-bottom: 10px;
    position: relative;
}

.footer-card-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 100%;
    max-width: 140px;
    background: rgba(255, 255, 255, 0.08);
}

.footer-card-desc {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px 14px;
    margin-top: 12px;
    margin-bottom: 0;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    transition: color 0.2s, background 0.2s;
}

.footer-social-link:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
}

.footer-social-icon {
    width: 18px;
    height: 18px;
}

.footer-social-link .footer-social-icon {
    width: 18px;
    height: 18px;
}

.footer-card-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-card-links li { margin-bottom: 6px; }
.footer-card-links li:last-child { margin-bottom: 0; }

.footer-card-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.2s;
}

.footer-card-links a:hover { color: var(--primary); }

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.85;
    margin: 0;
}

.footer-copy + .footer-copy { margin-top: 6px; }

/* ─── دکمه برگشت به بالا (همه صفحات) ─── */
.scroll-top-btn {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 900;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.scroll-top-btn:hover {
    background: rgba(34, 197, 94, 0.15);
    color: var(--primary);
}

.scroll-top-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

.scroll-top-btn[hidden] {
    display: none !important;
}

.scroll-top-icon {
    width: 22px;
    height: 22px;
}

/* تبلت و موبایل: فوتر یک ستون، وسط‌چین */
@media (max-width: 1024px) {
    .site-footer { padding: 24px 20px 20px; }
    .footer-inner { text-align: center; }
    .footer-sections,
    .footer-sections--cols-3,
    .footer-sections--cols-4 {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-bottom: 24px;
        text-align: center;
    }
    .footer-card-title::after {
        max-width: 100px;
        left: 50%;
        transform: translateX(-50%);
    }
    .footer-socials { justify-content: center; }
}

@media (max-width: 768px) {
    .site-footer { padding: 22px 18px 18px; }
    .footer-sections,
    .footer-sections--cols-3,
    .footer-sections--cols-4 {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-bottom: 22px;
    }
    .footer-card-title::after { max-width: 72px; }
    .footer-socials { margin-top: 14px; }
    .footer-copy { margin-bottom: 0; }
}

@media (max-width: 480px) {
    :root { --header-h: 52px; }
    .site-footer { padding: 20px 16px 16px; }
    .footer-sections { gap: 26px; margin-bottom: 20px; }
    .footer-card-title::after { max-width: 56px; }
    .footer-social-link { width: 34px; height: 34px; }
    .footer-social-icon { width: 16px; height: 16px; }
}

/* ─── باکس سکشن استاندارد (همه ابزارها) ─── */
.section-box {
    margin-bottom: var(--section-gap);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 18px 16px;
    background: transparent;
}

.section-box:last-child {
    margin-bottom: 0;
}

.section-box h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    :root { --section-gap: 20px; }
    .section-box { padding: 16px 14px; }
}
@media (max-width: 480px) {
    :root { --section-gap: 18px; }
    .section-box { padding: 14px 12px; }
}

/* ─── محتوای زیر ابزار (What is… / FAQ) – مثل BPM Tapper ─── */
.content-bottom {
    width: 100%;
    max-width: 640px;
    padding: var(--section-gap) 16px var(--section-gap);
    margin-top: var(--section-gap);
}

.content-body p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.content-body p:last-child { margin-bottom: 0; }

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.faq-item {
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    background: transparent;
}

.faq-item:first-of-type { border-radius: 0; }
.faq-item:last-of-type { border-bottom: none; border-radius: 0; }

.faq-item summary {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: "+";
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
    flex-shrink: 0;
}

.faq-item[open] summary::after { content: "−"; }

.faq-answer { padding: 0 14px 12px; }

.faq-answer p {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

@media (max-width: 768px) {
    .content-bottom { padding: var(--section-gap) 14px var(--section-gap); }
}

@media (max-width: 480px) {
    .content-bottom { padding: var(--section-gap) 12px var(--section-gap); }
    .faq-item summary { padding: 10px 12px; }
    .faq-answer { padding: 0 12px 10px; }
}

/* ─── صفحه لیست ابزارها (کارت‌ها) ─── */
.main-hero--tools-list {
    flex: 1;
    min-height: auto;
}

.main-center--tools-list {
    width: 100%;
    max-width: 960px;
}

.tools-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
    text-align: center;
}
.tools-page-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0 auto 32px;
    text-align: center;
    max-width: 560px;
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 960px;
    width: 100%;
}

@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
}
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.2s;
}
.tool-card:hover {
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: var(--shadow);
    background: rgba(26, 26, 26, 0.95);
}
.tool-card:hover::before {
    background: var(--primary);
}
.tool-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.tool-card-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}
.tool-card-title-link:hover {
    color: var(--primary);
}
.tool-card-title-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.tool-card p {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
    flex: 1;
}
.tool-card .btn-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--primary);
    color: #0a0a0a;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    align-self: flex-start;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.tool-card .btn-go:hover {
    background: #1ea34e;
}
.tool-card .btn-go:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* محتوای زیر هیرو در صفحه tools (Why / What is / FAQ) */
.content-bottom--tools {
    margin-left: auto;
    margin-right: auto;
}

/* ─── صفحه «به زودی» (coming soon) ─── */
.main-hero--coming-soon {
    flex: 1;
    min-height: 40vh;
}

.coming-soon-inner {
    text-align: center;
}

.coming-soon-title {
    font-size: 1.5rem;
    color: var(--text);
    margin: 0 0 12px;
}

.coming-soon-desc {
    color: var(--text-muted);
    margin: 0;
}

.coming-soon-back {
    margin-top: 20px;
}

.coming-soon-link {
    color: var(--primary);
    text-decoration: none;
}

.coming-soon-link:hover {
    text-decoration: underline;
}
