@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn.woff2') format('woff2-variations'),
    /* will be the standard and works in Safari now */
    url('../fonts/Vazirmatn.woff2') format('woff2');
    /* for the other supporting browsers */
    font-weight: 100 900;
    font-display: swap;
}
:root {
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-secondary: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #309255;
    --border-color: rgba(15, 23, 42, 0.08);
    --border-strong: #0f172a;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    --shadow-neo: 4px 4px 0px #0f172a;
    --shadow-neo-hover: 6px 6px 0px #0f172a;
    --radius-md: 16px;
    --radius-lg: 24px;
}

body.dark-mode {
    --bg-color: #121316;
    --surface-color: #1a1c23;
    --surface-secondary: #242731;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-neo: 4px 4px 0px rgba(0, 0, 0, 0.5);
    --shadow-neo-hover: 6px 6px 0px rgba(0, 0, 0, 0.7);
}

h1, h2, h3, h4, h5, h6, p, span, li, a, div {
    direction: ltr;
    unicode-bidi: isolate;
}

html[dir="rtl"] h1, 
html[dir="rtl"] h2, 
html[dir="rtl"] h3, 
html[dir="rtl"] h4, 
html[dir="rtl"] h5, 
html[dir="rtl"] h6, 
html[dir="rtl"] p, 
html[dir="rtl"] span, 
html[dir="rtl"] li, 
html[dir="rtl"] a, 
html[dir="rtl"] div {
    direction: rtl;
    unicode-bidi: isolate;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

html[dir="rtl"] * {
    font-family: 'Vazirmatn', sans-serif;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    position: relative;
    text-align: left;
}

html[dir="rtl"] body {
    text-align: right;
}

.edge-grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background-image: 
        linear-gradient(var(--text-main) 1px, transparent 1px),
        linear-gradient(90deg, var(--text-main) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.03;
    mask-image: radial-gradient(circle at center, transparent 40%, black 100%);
    -webkit-mask-image: radial-gradient(circle at center, transparent 40%, black 100%);
}

.bg-glow {
    position: fixed;
    width: 450px;
    height: 450px;
    background: var(--primary);
    opacity: 0.12;
    filter: blur(140px);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transition: background 0.4s ease;
}

.glow-1 { top: -100px; right: -100px; }
.glow-2 { bottom: 10%; left: -100px; }

a {
    text-decoration: none;
    color: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    border: 1.5px solid var(--border-strong);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.88rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff !important;
    box-shadow: var(--shadow-neo);
    border: none;
}

.btn-primary * {
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: var(--primary);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-neo-hover);
}

.btn-outline {
    background-color: var(--surface-color);
    color: var(--text-main);
    box-shadow: var(--shadow-neo);
}

.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neo-hover);
    background-color: var(--surface-secondary);
    color: var(--text-main);
}

.btn-large {
    padding: 14px 30px;
    font-size: 1.05rem;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background-color 0.4s ease;
}

body.dark-mode .navbar {
    background-color: rgba(18, 19, 22, 0.85);
}

.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo, .footer-logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.footer-logo {
    font-size: 2rem;
}

html[dir="ltr"] .logo, html[dir="ltr"] .footer-logo {
    direction: ltr !important;
}

html[dir="rtl"] .logo, html[dir="rtl"] .footer-logo {
    direction: rtl !important;
}

.brand-text {
    color: var(--text-main);
}

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

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    background: var(--surface-secondary);
    border: 1.5px solid var(--border-strong);
    border-radius: 20px;
    padding: 2px;
    box-shadow: 2px 2px 0px var(--border-strong);
    direction: ltr !important;
}

.lang-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.lang-btn.active {
    background-color: var(--primary);
    color: #ffffff !important;
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 38px;
    height: 38px;
    background: var(--surface-color);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 9px;
    cursor: pointer;
    box-shadow: 2px 2px 0px var(--border-strong);
}

.hamburger-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
}

.hero {
    max-width: 1140px;
    margin: 150px auto 80px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: left;
}

html[dir="rtl"] .hero-content {
    text-align: right;
}

.badge {
    display: inline-block;
    padding: 5px 16px;
    background-color: var(--surface-secondary);
    color: var(--primary);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 20px;
    box-shadow: 2px 2px 0px var(--border-strong);
}

.hero h1 {
    font-size: 2.8rem;
    line-height: 1.35;
    margin-bottom: 20px;
    font-weight: 900;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 28px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: flex-start;
}

.mockup-window {
    background-color: var(--surface-color);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-neo);
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.mockup-window:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-neo-hover);
}

.mockup-header {
    background-color: var(--surface-secondary);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.mockup-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    background: var(--bg-color);
}

.mockup-search {
    width: 85%;
    height: 42px;
    background-color: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    box-shadow: 2px 2px 0px var(--border-strong);
}

.mockup-shortcuts {
    display: flex;
    gap: 12px;
}

.shortcut-item {
    width: 44px;
    height: 44px;
    background-color: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    box-shadow: 2px 2px 0px var(--border-strong);
}

.mockup-cards {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    gap: 12px;
    width: 100%;
}

.m-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 3px 3px 0px var(--border-strong);
}

.timer-card { align-items: center; justify-content: center; }
.circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2.5px solid var(--primary);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
}
.timer-btns { display: flex; gap: 6px; width: 100%; }
.timer-btns span { height: 22px; flex: 1; background: var(--surface-secondary); border: 1px solid var(--border-color); border-radius: 6px; }

.t-header { font-weight: 800; font-size: 0.88rem; margin-bottom: 4px; }
.t-item { display: flex; align-items: center; gap: 8px; }
.t-check { width: 14px; height: 14px; border: 2px solid var(--border-strong); border-radius: 50%; }
.t-check.checked { background-color: var(--primary); border-color: var(--primary); }
.t-line { height: 6px; background-color: var(--surface-secondary); flex: 1; border-radius: 3px; }
.t-line.half { width: 50%; flex: none; }

.n-item { height: 28px; background-color: var(--surface-secondary); border-radius: 6px; }

.features-section, .cta-section {
    max-width: 1140px;
    margin: 120px auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-header h2, .split-content h2, .cta-section h2 {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 500;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.feature-card {
    background-color: var(--surface-color);
    padding: 28px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-neo);
    transition: all 0.3s ease;
    text-align: left;
}

html[dir="rtl"] .feature-card {
    text-align: right;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-neo-hover);
    border-color: var(--primary);
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    background-color: var(--surface-secondary);
    border: 1px solid var(--border-strong);
    box-shadow: 2px 2px 0px var(--border-strong);
}

.icon-box svg { width: 24px; height: 24px; color: var(--primary); }

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 800;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.split-section {
    max-width: 1140px;
    margin: 120px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.split-section.reverse .split-content {
    order: 2;
}

.split-section.reverse .split-image {
    order: 1;
}

.split-content {
    text-align: left;
}

html[dir="rtl"] .split-content {
    text-align: right;
}

.split-content p {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 24px;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.98rem;
    justify-content: flex-start;
    direction: ltr;
}

html[dir="rtl"] .feature-list li {
    direction: rtl;
}

.feature-list svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.analytics-mockup, .sync-mockup, .theme-mockup {
    background-color: var(--surface-color);
    color: var(--text-main);
    padding: 28px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-neo-hover);
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.stats-row {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
}

.stat-box {
    flex: 1;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface-secondary);
    box-shadow: 2px 2px 0px var(--border-strong);
    color: var(--text-main);
}
.stat-box span { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.stat-box strong { font-size: 1.5rem; font-weight: 900; color: var(--primary); }

.heatmap-wrapper {
    background: var(--surface-secondary);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 18px;
    color: var(--text-main);
}

.heatmap-title {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 12px;
    color: var(--text-main);
    text-align: left;
}

html[dir="rtl"] .heatmap-title {
    text-align: right;
}

.heatmap-creative {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.h-dot {
    aspect-ratio: 1;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.h-dot.l0 { 
    background-color: var(--surface-color); 
}

.h-dot.l1 { 
    background-color: var(--primary); 
    opacity: 0.25; 
}

.h-dot.l2 { 
    background-color: var(--primary); 
    opacity: 0.5; 
}

.h-dot.l3 { 
    background-color: var(--primary); 
    opacity: 0.75; 
}

.h-dot.l4 { 
    background-color: var(--primary); 
    opacity: 1; 
    border-color: var(--border-strong); 
}

.sync-card {
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-secondary);
    box-shadow: 3px 3px 0px var(--border-strong);
    transition: all 0.2s ease;
    color: var(--text-main);
    direction: ltr !important;
}

html[dir="rtl"] .sync-card {
    direction: rtl !important;
}

.sync-card:last-child { margin-bottom: 0; }

.s-info {
    display: flex;
    align-items: center;
    gap: 12px;
    direction: ltr !important;
}

html[dir="rtl"] .s-info {
    direction: rtl !important;
}

.s-icon {
    width: 42px; height: 42px;
    background: var(--surface-color);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 2px 2px 0px var(--border-strong);
    flex-shrink: 0;
}
.s-icon svg { width: 20px; height: 20px; color: var(--primary); }
.s-text { 
    display: flex; 
    flex-direction: column; 
    gap: 2px; 
    text-align: left !important;
}

html[dir="rtl"] .s-text {
    text-align: right !important;
}

.s-title { font-weight: 800; font-size: 1rem; color: var(--text-main); }
.s-status { font-size: 0.8rem; font-weight: 700; color: var(--primary); }

.disconnect-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}
.sync-card:hover .disconnect-btn {
    opacity: 1;
}

.theme-header {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    background: transparent !important;
    text-align: left;
}

html[dir="rtl"] .theme-header {
    text-align: right;
}

.theme-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.theme-row:last-child { margin-bottom: 0; }
.theme-row span {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-main);
}
.mode-toggle {
    display: flex;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-secondary);
    box-shadow: 2px 2px 0px var(--border-strong);
}
.mode-btn {
    padding: 6px 14px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}
.mode-btn.active {
    background: var(--primary);
    color: #ffffff !important;
}
.color-palette {
    display: flex;
    gap: 8px;
}
.c-dot {
    width: 26px; height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    box-shadow: 2px 2px 0px var(--border-strong);
    transition: transform 0.2s ease;
}
.c-dot.active, .c-dot:hover {
    transform: scale(1.15);
}

.cta-section {
    text-align: center;
    background-color: var(--surface-color);
    padding: 64px 20px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-neo-hover);
}

.cta-section p {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 32px;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

footer {
    background-color: var(--surface-color);
    color: var(--text-main);
    border-top: 1px solid var(--border-color);
    padding: 64px 20px 32px;
    margin-top: 120px;
    position: relative;
    overflow: hidden;
}

.footer-bg-icon {
    position: absolute;
    color: var(--text-main);
    opacity: 0.03;
    z-index: 0;
}
.footer-bg-icon.icon-1 { width: 120px; height: 120px; top: 10%; right: 5%; transform: rotate(15deg); }
.footer-bg-icon.icon-2 { width: 160px; height: 160px; bottom: -10%; right: 25%; transform: rotate(-10deg); }
.footer-bg-icon.icon-3 { width: 120px; height: 120px; top: 20%; left: 35%; transform: rotate(30deg); }
.footer-bg-icon.icon-4 { width: 140px; height: 140px; bottom: 10%; left: 8%; transform: rotate(-20deg); }
.footer-bg-icon.icon-5 { width: 80px; height: 80px; top: -5%; left: 18%; transform: rotate(5deg); }

.footer-content {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    transition: color 0.2s;
}

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

.credit {
    margin-top: 24px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
}

.credit span {
    color: var(--primary);
    font-weight: 800;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 992px) {
    .hero, .split-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    .hero-content, .split-content {
        text-align: center !important;
    }
    .hero-actions {
        justify-content: center;
    }
    .split-section.reverse .split-content,
    .split-section.reverse .split-image {
        order: initial;
    }
    .hero h1 { font-size: 2.2rem; }
    .feature-list { align-items: center; }
    .feature-list li {
        justify-content: center;
    }
    .mockup-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--surface-color);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        display: none;
        box-shadow: var(--shadow-soft);
    }
    .mobile-menu-btn {
        display: inline-flex !important;
        margin-top: 10px;
        width: 100%;
    }

    .nav-links.active {
        display: flex;
    }
    .nav-actions .btn-sm, .disconnect-btn { display: none;}

    .hero h1 { font-size: 1.8rem; }
    .section-header h2, .split-content h2, .cta-section h2 { font-size: 1.6rem; }
    .download-buttons { flex-direction: column; width: 100%; max-width: 280px; margin: 0 auto; }
    .btn-large { width: 100%; }
    .sync-card { flex-direction: column; gap: 12px; }
    .disconnect-btn { opacity: 1; width: 100%; }
    .footer-links { flex-direction: column; gap: 12px; }
}
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }
}