:root {
    --bg: #111;
    --card-bg: #1e1e1e;
    --text: #fff;
    --text-muted: #aaa;
    --accent: #3699ff;
    --radius: 6px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
}

/* --- BACKGROUND ART --- */
.bg-art {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: -1; opacity: 0.16; 
    filter: grayscale(100%) contrast(1.2); pointer-events: none;
}

/* --- WRAPPER --- */
.site-wrapper {
    max-width: 1200px; /* Widened slightly for better masonry */
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* --- HERO --- */
.hero {
    text-align: center;
    padding: 80px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}
.hero-logo { 
    max-width: 140px; height: auto; margin: 0 auto 25px; display: block; 
}
.hero h1 { 
    font-size: 2.8rem; margin: 0 0 15px 0; line-height: 1.1; font-weight: 800; letter-spacing: -1px; 
}
.hero p { 
    font-size: 1.1rem; color: var(--text-muted); font-weight: 400; max-width: 600px; margin: 0 auto; 
}

/* --- STYLED LISTS (Horizontal Flow) --- */
ul {
    list-style: none;
    padding: 0;
    margin: 30px auto; /* Auto margin centers the container itself if width is limited */
    max-width: 1000px; /* Optional: constrains width so items wrap nicely on large screens */
    display: flex;
    flex-direction: row; /* Items sit side-by-side */
    flex-wrap: wrap;     /* Items jump to next line when needed */
    justify-content: center; /* Centers the whole group horizontally */
    gap: 15px;
}

li {
    border: 1px solid var(--accent);
    box-shadow: 0 0 15px rgba(54, 153, 255, 0.25);
    padding: 8px 20px;
    border-radius: var(--radius);
    text-align: center;
    background: rgba(54, 155, 255, 0.183);
    transition: all 0.3s ease;
    font-weight: 500;
    /* Flex shorthand: don't grow, allow shrink, auto size */
    flex: 0 1 auto; 
}

li:hover {
    box-shadow: 0 0 25px rgba(54, 153, 255, 0.5);
    background: rgba(54, 153, 255, 0.1);
    transform: translateY(-2px);
}
/* --- FILTERS --- */
.filter-container {
    display: flex; justify-content: center; gap: 10px; 
    margin-bottom: 30px; padding: 0 20px; flex-wrap: wrap;
}
.filter-btn {
    background: transparent; border: 1px solid #333; color: #888;
    padding: 6px 20px; border-radius: 50px; cursor: pointer;
    font-size: 0.9rem; font-weight: 500; transition: all 0.2s ease;
}
.filter-btn:hover, .filter-btn.active {
    border-color: var(--accent); color: #fff; background: rgba(54, 153, 255, 0.1);
}

/* --- BENTO GRID ENGINE (MASONRY FIX) --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    /* KEY CHANGE: 1px rows allow precise height control to eliminate gaps */
    grid-auto-rows: 1px; 
    grid-auto-flow: dense; 
    gap: 15px; 
    padding: 0 20px 40px;
    box-sizing: border-box;
    width: 100%;
}

/* --- CARD STYLES --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.bento-card {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    display: flex; 
    flex-direction: column;
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Sizes */
.size-1-3 { grid-column: span 2; }
.size-2-3 { grid-column: span 4; }
.size-full { grid-column: span 6; }

.bento-card.hidden { display: none !important; }

/* Interactions */
.bento-card:hover { z-index: 2; transform: translateY(-3px); box-shadow: 0 10px 40px rgba(0,0,0,0.4); transition: transform 0.3s, box-shadow 0.3s; }
.bento-card .main-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
    transition: transform 0.6s ease, opacity 0.3s; 
    flex-grow: 1;
}
.bento-card:hover .main-img { transform: scale(1.03); opacity: 1; }

.card-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 15px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    transform: translateY(10px); opacity: 0; transition: 0.3s; pointer-events: none;
}
.bento-card:hover .card-content { transform: translateY(0); opacity: 1; }
.card-content h3 { margin: 0; font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.2; }
.card-content span { font-size: 0.8rem; color: #ccc; display: block; margin-top: 4px; }

/* --- SECTION TAGS --- */
.section-tag {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    padding: 4px 10px; border-radius: 4px; font-size: 0.7rem;
    font-weight: 600; color: #fff; display: flex; align-items: center; gap: 6px; z-index: 5;
    pointer-events: none; letter-spacing: 0.5px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* --- PORTFOLIO BUTTON --- */
.portfolio-btn-container { text-align: center; padding: 20px 20px 60px; }
.portfolio-link-btn {
    display: inline-block; padding: 12px 35px; background: transparent; color: var(--text-muted);
    text-decoration: none; font-weight: 500; font-size: 0.95rem; border: 1px solid #444; border-radius: 50px; transition: all 0.2s ease;
}
.portfolio-link-btn:hover {
    border-color: var(--accent); color: #fff; background: rgba(54, 153, 255, 0.05);
    box-shadow: 0 0 15px rgba(54, 153, 255, 0.1); transform: translateY(-2px);
}

/* --- CONTACT FORM --- */
.contact-section { background: #0b0b0b; border-top: 1px solid #222; padding: 60px 20px; margin-top: auto; }
.contact-container { max-width: 800px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 40px; }
.contact-info h2 { font-size: 2rem; margin-top: 0; margin-bottom: 10px; }
.contact-info p { color: #888; margin-bottom: 1.5rem; }

.contact-form { display: flex; flex-direction: column; gap: 15px; }
.form-group label { display: block; margin-bottom: 6px; color: #888; font-size: 0.85rem; font-weight: 500; }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px; background: #151515;
    border: 1px solid #333; color: #fff; border-radius: 6px; font-family: inherit;
    box-sizing: border-box; transition: 0.2s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); outline: none; background: #1a1a1a; }

.btn-submit { background: var(--accent); color: #fff; padding: 14px; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; margin-top: 10px; width: 100%; transition: 0.2s; }
.btn-submit:hover { background: #2b80ff; }

.social-links { display: flex; gap: 15px; margin-top: 25px; }
.social-btn { width: 42px; height: 42px; border-radius: 50%; background: #1a1a1a; color: #ccc; display: flex; align-items: center; justify-content: center; transition: 0.2s; border: 1px solid #333; }
.social-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- HIDDEN DATA FOR MODAL --- */
.hidden-data { display: none; }

/* --- MODAL --- */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.98); z-index: 500; padding: 10px; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: #111; width: 100%; max-width: 900px; max-height: 90vh; overflow-y: auto; border-radius: 12px; position: relative; padding: 30px; border: 1px solid #333; }
.close-modal { position: sticky; top: 0; float: right; font-size: 2rem; cursor: pointer; color: #fff; z-index: 10; margin-bottom: 10px; line-height: 1; background: rgba(0,0,0,0.5); width: 40px; height: 40px; text-align: center; border-radius: 50%; }
.modal-body h2 { margin-top: 0; }
.modal-body img { width: 100%; border-radius: 6px; margin-bottom: 15px; display: block; }
.accent { color: var(--accent); font-weight: bold; display: block; margin-bottom: 10px; }

/* --- MOBILE --- */
@media (max-width: 768px) {
    .site-wrapper { max-width: 100%; box-shadow: none; }
    
    .bento-grid {
        padding: 0 10px 30px;
        gap: 10px;
        grid-template-columns: repeat(2, 1fr); /* 2 Columns on mobile for better masonry */
    }
    
    .size-1-3 { grid-column: span 1 !important; }
    .size-2-3 { grid-column: span 2 !important; }
    .size-full { grid-column: span 2 !important; }

    .hero { padding: 60px 20px 30px; }
    .hero h1 { font-size: 2.2rem; }
    
    .section-tag { position: relative; top: 0; right: 0; margin-top: 5px; background: transparent; padding: 0; }
    
    .card-content {
        position: relative;
        transform: none !important;
        opacity: 1 !important;
        background: #1e1e1e;
        padding: 12px;
    }
}