/* 
========================================
1. CORE DESIGN SYSTEM (2026 ARCHITECTURE)
========================================
*/
:root {
    /* Palette: Bright, Clean, Architectural */
    --bg-body: #ffffff;
    --bg-alt: #f4f4f4;       /* خاکستری بسیار روشن */
    --text-main: #1a1a1a;    /* مشکی ذغالی */
    --text-light: #666666;   /* خاکستری */
    
    --accent: #c5a059;       /* طلایی مات */
    --accent-hover: #b08d4b;
    
    /* Spacing & Layout */
    --container-width: 1400px;
    --section-padding: 100px;
    
    /* UI Elements */
    --radius-std: 4px;       /* گوشه‌های مهندسی */
    --shadow-card: 0 10px 40px rgba(0,0,0,0.06);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }

html, body {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.8;
}

h1, h2, h3, h4 { font-weight: 800; line-height: 1.3; margin-bottom: 1rem; color: var(--text-main); }
p { margin-bottom: 1.5rem; color: var(--text-light); }
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { display: block; width: 100%; height: auto; object-fit: cover; }
ul { list-style: none; }

/* Utility */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 70px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
}

/* 
========================================
2. ARCHITECTURAL LOADER
========================================
*/
#loader {
    position: fixed; inset: 0;
    background: #1a1a1a;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* transition برای opacity و visibility */
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
}

/* کلاس کمکی برای مخفی کردن لودر توسط جاوااسکریپت */
#loader.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* این خط حیاتی است تا کاربر بتواند کلیک کند */
}

.loader-svg {
    width: 100px;
    height: 100px;
}

.house-path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: drawHouse 1.2s ease-in-out forwards;
}

.loader-text {
    margin-top: 20px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 1.2rem;
    opacity: 0;
    animation: fadeInText 0.5s ease-out 0.8s forwards;
}

@keyframes drawHouse {
    to { stroke-dashoffset: 0; }
}

@keyframes fadeInText {
    to { opacity: 1; transform: translateY(0); }
}

/* 
========================================
3. NAVIGATION
========================================
*/
.navbar {
    position: fixed; top: 0; left: 0; width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

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

.logo { font-size: 1.8rem; font-weight: 900; letter-spacing: 1px; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.navbar.scrolled .logo { color: var(--text-main); text-shadow: none; }

.nav-menu { display: flex; gap: 35px; }
.nav-menu a {
    color: #fff; font-weight: 500; font-size: 1rem; position: relative;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.navbar.scrolled .nav-menu a { color: var(--text-main); text-shadow: none; }

.nav-menu a::after {
    content: ''; position: absolute; bottom: -5px; right: 0; width: 0; height: 2px;
    background: var(--accent); transition: 0.3s;
}
.nav-menu a:hover::after { width: 100%; }

.hamburger { display: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.navbar.scrolled .hamburger { color: var(--text-main); }

/* 
========================================
4. HERO SECTION (NEW IMAGE)
========================================
*/
.hero {
    height: 100vh;
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* تصویر جدید: ساختمان مدرن و سازه که موضوع سایت را منتقل میکند */
    background: url('https://amirdadgostar.github.io/site/ememari/Asli.jpg') center/cover no-repeat;
}

.hero::before {
    content: ''; position: absolute; inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1;
}

.hero-content { position: relative; z-index: 2; padding: 0 20px; color: #fff; }

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.hero p {
    font-size: 1.3rem; 
    color: #f0f0f0; 
    margin-bottom: 40px; 
    max-width: 700px; 
    margin-left: auto; 
    margin-right: auto;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    font-weight: 400;
}

.btn-cta {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 16px 45px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: var(--radius-std);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-cta:hover {
    transform: translateY(-5px);
    background: var(--accent-hover);
    box-shadow: 0 15px 30px rgba(197, 160, 89, 0.6);
}

/* 
========================================
5. ABOUT SECTION
========================================
*/
.about-section { padding: var(--section-padding) 0; background: var(--bg-body); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }

.about-image {
    position: relative;
    height: 500px;
    border-radius: var(--radius-std);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.experience-badge {
    position: absolute; bottom: -20px; left: -20px;
    background: #fff; padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 4px solid var(--accent);
}
.experience-badge span { display: block; font-size: 3rem; font-weight: 900; color: var(--accent); line-height: 1; }
.experience-badge p { margin: 0; font-size: 0.9rem; color: var(--text-main); font-weight: 700; }

/* 
========================================
6. PROJECTS (UPDATED CONTENT)
========================================
*/
.projects-section { padding: var(--section-padding) 0; background: var(--bg-alt); }

.filter-buttons {
    display: flex; justify-content: center; gap: 15px; margin-bottom: 50px; flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    border: 1px solid #ddd;
    background: transparent;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text-light);
    font-family: inherit; font-size: 1rem;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--text-main); color: #fff; border-color: var(--text-main);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    width: 100%;
}

.project-card {
    background: #fff;
    border-radius: var(--radius-std);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
    position: relative;
    height: 400px;
    cursor: pointer;
}

.project-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }

.project-img { width: 100%; height: 100%; object-fit: cover; transition: 0.6s; }
.project-card:hover .project-img { transform: scale(1.1); }

.project-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 10%, rgba(0,0,0,0.7) 50%, transparent 100%);
    padding: 30px; 
    color: #fff;
    transform: translateY(0);
    transition: 0.4s;
    z-index: 2;
}

.project-overlay h3 { 
    color: #fff; 
    margin-bottom: 5px; 
    text-shadow: 0 2px 5px rgba(0,0,0,1);
}

.project-overlay p { 
    color: #ddd; 
    margin: 0; 
    font-size: 0.9rem;
    text-shadow: 0 1px 3px rgba(0,0,0,1);
}

/* 
========================================
7. SERVICES
========================================
*/
.services-section { padding: var(--section-padding) 0; }

.services-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px;
}

.service-card {
    padding: 40px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius-std);
    transition: var(--transition);
}

.service-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-card);
}

.service-icon {
    font-size: 2.5rem; color: var(--accent); margin-bottom: 25px;
}

/* 
========================================
8. CONTACT & ROUTING BUTTONS
========================================
*/
.contact-section { background: var(--text-main); color: #fff; padding: 80px 0; }

.contact-wrapper {
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}

.contact-info h3 { color: #fff; font-size: 2rem; margin-bottom: 30px; }
.contact-item { display: flex; gap: 15px; margin-bottom: 20px; align-items: center; }
.contact-item i { color: var(--accent); font-size: 1.2rem; }
.contact-item span { color: #ccc; }

/* Routing Buttons Style */
.routing-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 20px;
}

.route-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-std);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    transition: 0.3s;
    font-size: 0.95rem;
    font-weight: 500;
}

.route-btn:hover {
    background: #fff;
    color: var(--text-main);
    transform: translateY(-2px);
}

.route-btn i { font-size: 1.1rem; }

.map-container {
    height: 350px;
    background: #333;
    border-radius: var(--radius-std);
    overflow: hidden;
}
.map-container iframe { width: 100%; height: 100%; border: 0; filter: grayscale(100%) invert(92%) contrast(83%); }

footer {
    background: #111; color: #555; padding: 30px 0; text-align: center; font-size: 0.9rem;
}

/* 
========================================
9. FLOATING ACTION BUTTONS
========================================
*/
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fab {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transition: 0.3s;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.fab:hover { transform: scale(1.1); }

.fab.whatsapp { background: #25D366; }
.fab.phone { 
    background: var(--accent); 
    animation: pulse 2s infinite; 
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(197, 160, 89, 0); }
    100% { box-shadow: 0 0 0 0 rgba(197, 160, 89, 0); }
}

/* 
========================================
RESPONSIVE DESIGN
========================================
*/
@media (max-width: 992px) {
    .about-grid, .contact-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .about-image { height: 350px; order: -1; }
    .nav-menu {
        position: fixed; top: 0; right: -100%; width: 80%; height: 100vh;
        background: #fff; flex-direction: column; padding: 80px 40px;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1); transition: 0.4s;
    }
    .nav-menu.active { right: 0; }
    .nav-menu a { color: var(--text-main); font-size: 1.2rem; text-shadow: none; }
    .hamburger { display: block; z-index: 1001; }
    .hamburger.active { color: var(--text-main); }
    .hero h1 { font-size: 2.2rem; }
    .section-header h2 { font-size: 2rem; }
}
