/* Google Font Vazirmatn for Persian Text */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;600;800&display=swap');

:root {
    --primary-bg: #f0f4f8; /* Light gray-blue */
    --secondary-bg: #e1e8ed;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --accent-color: #b0c4de; /* Powder Blue */
    --accent-hover: #9bb5d4;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

[data-theme="dark"] {
    --primary-bg: #0f172a; /* Dark slate */
    --secondary-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent-color: #7dd3fc; /* Bright powder blue for dark mode */
    --accent-hover: #38bdf8;
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    transition: background 0.4s ease, color 0.4s ease;
    min-height: 100vh;
    overflow-x: hidden;
    direction: rtl; /* Persian is RTL */
    position: relative;
}

/* Background blob effects */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.6;
    animation: blob-bounce 10s infinite alternate;
}

.blob-1 {
    top: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: var(--accent-color);
}

.blob-2 {
    bottom: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: #3b82f6;
    opacity: 0.15;
    animation-delay: 2s;
}

@keyframes blob-bounce {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(-20px, 20px); }
}

/* Glassmorphism Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
}

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3%;
    position: sticky;
    top: 20px;
    margin: 0 5%;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--text-primary), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    font-size: 1.1rem;
}

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

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    background: var(--glass-bg);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 85vh;
    padding: 0 8%;
    gap: 4rem;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-title span {
    background: linear-gradient(120deg, var(--accent-color), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--primary-bg);
    border: 2px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    background: transparent;
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.hero-image {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 90%;
    border-radius: 40px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    animation: float 6s ease-in-out infinite;
    border: 8px solid var(--glass-border);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Features Section */
.features {
    padding: 5rem 8%;
    margin-top: 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    font-weight: 800;
}

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

.card {
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.4s ease;
}

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

.card-icon {
    font-size: 3.5rem;
    background: linear-gradient(45deg, var(--accent-color), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.card-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Gallery Section */
.gallery {
    padding: 5rem 8%;
}

.gallery-masonry {
    column-count: 4;
    column-gap: 1.5rem;
}

@media (max-width: 1200px) {
    .gallery-masonry { column-count: 3; }
}

@media (max-width: 768px) {
    .gallery-masonry { column-count: 2; }
}

@media (max-width: 480px) {
    .gallery-masonry { column-count: 1; }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
    will-change: transform;
    border: 2px solid var(--glass-border);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
    will-change: transform;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    z-index: 1;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Scroll Reveal Animations (High Performance) */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}
.reveal-right {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}
.reveal-nav {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.reveal.active, .reveal-right.active, .reveal-nav.active {
    opacity: 1;
    transform: translate(0, 0);
}

/* About Section */
.about {
    padding: 5rem 8%;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    padding: 3rem;
    border-radius: 30px;
}

.about-text {
    flex: 1;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.about-icon {
    flex: 0.5;
    display: flex;
    justify-content: center;
    font-size: 10rem;
    color: var(--accent-color);
    opacity: 0.8;
}

/* Contact Section */
.contact {
    padding: 2rem 8%;
}

.contact-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.contact-info {
    padding: 3rem;
    max-width: 600px;
    width: 100%;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-links.center-social {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 15px;
}

.social-btn i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.social-btn:hover {
    transform: translateX(-10px);
    background: var(--accent-color);
    color: var(--primary-bg);
}

.social-btn:hover i {
    color: var(--primary-bg);
}

.contact-form {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

[data-theme="dark"] .contact-form input,
[data-theme="dark"] .contact-form textarea {
    background: rgba(0, 0, 0, 0.2);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(176, 196, 222, 0.3);
}

.contact-form button {
    width: 100%;
    justify-content: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    margin: 2rem 5% 1rem 5%;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        margin-top: 4rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-image img {
        margin-top: 3rem;
        max-width: 100%;
    }
    
    .about-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
        padding: 2rem;
    }
    
    .about-icon {
        font-size: 6rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info, .contact-form {
        padding: 2rem;
    }
}
