:root {
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #fee2e2;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-alt: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px -5px rgba(220, 38, 38, 0.12), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-hover: 0 20px 30px -10px rgba(220, 38, 38, 0.25);
    --header-bg: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] {
    --primary: #ef4444;
    --primary-dark: #dc2626;
    --primary-light: #7f1d1d;
    --accent: #fb923c;
    --accent-hover: #f97316;
    --bg-body: #0f090d;
    --bg-card: #1c1117;
    --bg-card-alt: #2a1b22;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #3f232e;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 20px 30px -10px rgba(239, 68, 68, 0.25);
    --header-bg: rgba(28, 17, 23, 0.92);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.8;
    overflow-x: hidden;
}

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

/* Navbar */
nav {
    position: sticky;
    top: 0;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.25rem;
}

.brand i {
    font-size: 1.6rem;
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

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

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

.theme-toggle-btn {
    background: var(--bg-card-alt);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    color: var(--accent);
    transform: rotate(20deg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
}

.btn-secondary {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    padding: 80px 0 50px;
    position: relative;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

[data-theme="dark"] .hero-badge {
    color: var(--primary);
}

.hero h1 {
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.35;
    margin-bottom: 16px;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.9;
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.urban-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    width: 100%;
    max-width: 380px;
    height: 380px;
    border-radius: 32px;
    box-shadow: var(--shadow-hover);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    border: 8px solid var(--bg-card);
}

.urban-card::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 10%, transparent 60%);
    top: -25%;
    left: -25%;
}

.urban-card i {
    font-size: 5.5rem;
    margin-bottom: 18px;
    color: #ccfbf1;
}

.urban-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.urban-card p {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Stats */
.stats-section {
    padding: 20px 0 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.stat-item {
    text-align: center;
    padding: 10px;
    border-left: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-left: none;
}

.stat-num {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 4px;
}

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

/* Section Header */
.section {
    padding: 70px 0;
}

.section-alt {
    background: var(--bg-card-alt);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 50px;
}

.section-tag {
    display: inline-block;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.service-card {
    background: var(--bg-card);
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.service-icon-wrap {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.skills-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.skills-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background: var(--bg-card-alt);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.skill-tag:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary);
}

/* Timeline Section */
.timeline {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 20px;
    width: 3px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-right: 55px;
    margin-bottom: 36px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    right: 12px;
    top: 6px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border: 4px solid var(--bg-body);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
}

.timeline-date {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

[data-theme="dark"] .timeline-date {
    color: var(--primary);
}

.timeline-content h3 {
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.timeline-content h4 {
    font-size: 0.92rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-content p {
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* Projects Filter & Grid */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 35px;
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 28px;
}

.project-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.project-header {
    padding: 24px 24px 12px;
}

.project-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 9999px;
    margin-bottom: 12px;
}

[data-theme="dark"] .project-badge {
    color: var(--primary);
}

.project-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
}

.project-body {
    padding: 0 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.project-metrics {
    background: var(--bg-card-alt);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px dashed var(--border-color);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tags span {
    font-size: 0.78rem;
    background: var(--bg-card-alt);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}

/* Urban Interactive Tools Section */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 28px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.tool-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.tool-form-group {
    margin-bottom: 16px;
}

.tool-form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.tool-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card-alt);
    color: var(--text-main);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s;
}

.tool-input:focus {
    border-color: var(--primary);
}

.tool-result {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    display: none;
}

.tool-result.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.result-row:last-child {
    border-bottom: none;
}

.result-val {
    font-weight: 800;
    color: var(--primary);
}

/* Contact */
.contact-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 48px;
    box-shadow: var(--shadow-md);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 48px;
}

.contact-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.4;
    color: var(--text-main);
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.info-item i {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card-alt);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid #a7f3d0;
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-theme="dark"] .alert-success {
    background: #064e3b;
    color: #a7f3d0;
    border-color: #047857;
}

/* Footer */
footer {
    background: #090d16;
    color: #94a3b8;
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid #1e293b;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-actions {
        justify-content: center;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat-item:nth-child(2) {
        border-left: none;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-item {
        border-left: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 16px;
    }
    .stat-item:last-child {
        border-bottom: none;
    }
    .contact-box {
        padding: 24px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
