/* ======================================================= */
/* ============= COMPLETE & UNIFIED STYLESHEET ============= */
/* ======================================================= */

/* --- Global Styles & Variables --- */
:root {
    --bg-color: #f4f4f9;
    --text-color: #1a1a1a;
    --card-bg: #ffffff;
    --accent-color: #4a4aef;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --border-color: #e0e0e0;
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --accent-color: #7b7bf5;
    --shadow-color: rgba(0, 0, 0, 0.25);
    --border-color: #333333;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
a { color: var(--accent-color); text-decoration: none; font-weight: 500; }

/* --- Header & Navigation --- */
header nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-color); }
.nav-right { display: flex; align-items: center; gap: 20px; }
#theme-toggle { background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-color); padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 0.9rem; transition: background 0.3s; }
#theme-toggle:hover { background: var(--bg-color); }

/* --- Intro Section --- */
.intro { text-align: center; padding: 60px 0; }
.intro h1 { font-size: 2.8rem; font-weight: 700; margin-bottom: 10px; line-height: 1.2; }
.intro p { font-size: 1.1rem; color: var(--text-color); opacity: 0.8; max-width: 600px; margin: 0 auto; }

/* --- Bento Grid Layout --- */
.bento-grid { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(200px, auto); }
.bento-item { background-color: var(--card-bg); border-radius: 12px; box-shadow: 0 4px 12px var(--shadow-color); padding: 25px; background-size: cover; background-position: center; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.3s, box-shadow 0.3s; }
.bento-item:hover { transform: translateY(-5px); box-shadow: 0 8px 20px var(--shadow-color); }
.bento-item .item-content { background-color: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; color: #fff; }
.bento-item:not([style*="background-image"]) .item-content { background: none; padding: 0; color: var(--text-color); }
.bento-item h3 { margin-bottom: 8px; font-size: 1.4rem; }
.bento-item p { font-size: 0.9rem; opacity: 0.9; }
.bento-item.item-1 { grid-column: span 2; grid-row: span 2; }
.bento-item.item-2 { grid-column: span 2; }
.bento-item.item-4 { align-self: end; }
.bento-item.item-5 { grid-column: span 4; text-align: center; }
.profile-pic { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 15px; border: 3px solid var(--accent-color); }
.social-links { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 15px; }
.skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 15px; }
.skills span { background-color: var(--bg-color); padding: 5px 12px; border-radius: 15px; font-size: 0.85rem; border: 1px solid var(--border-color); }

/* --- Section Title --- */
.section-title { text-align: center; margin-bottom: 40px; margin-top: 60px; }
.section-title h2 { font-size: 2.2rem; font-weight: 700; margin-bottom: 8px; }
.section-title p { font-size: 1.1rem; opacity: 0.8; }
.section { padding: 0; } 

/* --- Experience & Education Grid --- */
#experience { margin-top: 60px; }
.experience-grid { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }
.exp-card { background-color: var(--card-bg); border-radius: 12px; padding: 25px; border: 1px solid var(--border-color); box-shadow: 0 4px 12px var(--shadow-color); display: flex; flex-direction: column; gap: 5px; }
.exp-card.wide { grid-column: span 2; }
.exp-icon { width: 32px; height: 32px; color: var(--accent-color); margin-bottom: 15px; }
.exp-icon svg { fill: currentColor; }
.exp-card h4 { font-size: 1.2rem; font-weight: 600; line-height: 1.3; }
.exp-card .exp-company { font-weight: 500; }
.exp-card .exp-meta { font-size: 0.9rem; opacity: 0.7; }
.exp-card p { font-size: 0.95rem; opacity: 0.9; margin-top: 10px; }

/* --- Masonry Gallery --- */
#work { margin-top: 60px; }
.gallery-grid { column-count: 4; column-gap: 20px; }
.gallery-item { display: inline-block; width: 100%; margin-bottom: 20px; break-inside: avoid; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px var(--shadow-color); transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer; }
.gallery-item img { width: 100%; height: auto; display: block; }
.gallery-item:hover { transform: translateY(-5px); box-shadow: 0 8px 20px var(--shadow-color); }

/* --- Lightbox Styles --- */
.lightbox { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); justify-content: center; align-items: center; animation: fadeIn 0.3s; padding: 1rem; }
.lightbox.active { display: flex; }
.lightbox-content { position: relative; width: 100%; height: 100%; max-width: 1200px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
#lightbox-img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; flex: 1 1 auto; min-height: 0; object-fit: contain; border-radius: 4px; }
.close-button { position: absolute; top: 5px; right: 10px; color: #fff; font-size: 45px; font-weight: 300; line-height: 1; cursor: pointer; transition: color 0.2s, transform 0.2s; z-index: 1001; }
.close-button:hover { color: #bbb; transform: scale(1.1); }
.caption { color: #ccc; text-align: center; padding: 1rem 0.5rem; font-size: 1rem; line-height: 1.4; flex-shrink: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Contact Form Section --- */
#contact { padding: 60px 0; background-color: var(--card-bg); margin-top: 60px; }
.contact-form { max-width: 800px; margin: 0 auto; }
.form-group-row { display: flex; gap: 20px; }
.form-group { margin-bottom: 20px; width: 100%; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-color); }
.form-group input, .form-group textarea { width: 100%; padding: 12px 15px; border-radius: 8px; border: 1px solid var(--border-color); background-color: var(--bg-color); color: var(--text-color); font-size: 1rem; font-family: 'Inter', sans-serif; transition: border-color 0.3s, box-shadow 0.3s; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 25%, transparent); }
.form-group textarea { resize: vertical; }
.form-submit { text-align: center; }
.submit-btn { padding: 12px 30px; font-size: 1.1rem; font-weight: 600; color: #fff; background-color: var(--accent-color); border: none; border-radius: 30px; cursor: pointer; transition: background-color 0.3s, transform 0.3s; }
.submit-btn:hover { background-color: color-mix(in srgb, var(--accent-color) 85%, #000); transform: translateY(-3px); }

/* --- Footer --- */
footer { padding: 50px 0; margin-top: 60px; border-top: 1px solid var(--border-color); background-color: var(--card-bg); }
.footer-container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 30px; }
.footer-left h2 { font-size: 1.8rem; font-weight: 600; margin-bottom: 10px; }
.footer-left p { margin-bottom: 20px; max-width: 400px; opacity: 0.8; }
.footer-contact-links { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-link { font-weight: 500; font-size: 1.1rem; color: var(--accent-color); position: relative; }
.footer-link::after { content: ''; position: absolute; width: 100%; height: 2px; background: var(--accent-color); left: 0; bottom: -4px; transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }
.footer-link:hover::after { transform: scaleX(1); }
.footer-right { text-align: right; }
.footer-social { display: flex; gap: 15px; justify-content: flex-end; margin-bottom: 20px; }
.social-link { display: flex; justify-content: center; align-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-color); color: var(--text-color); transition: all 0.3s ease; }
.social-link svg { width: 22px; height: 22px; fill: currentColor; }
.social-link:hover { background-color: var(--accent-color); border-color: var(--accent-color); color: #fff; transform: translateY(-3px); }
.footer-copyright { font-size: 0.9rem; opacity: 0.7; }

/* =========================================== */
/* =========== RESPONSIVE DESIGN ============= */
/* =========================================== */
@media (max-width: 1200px) {
    .gallery-grid { column-count: 3; }
    .experience-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
    .intro h1 { font-size: 2.2rem; }
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { column-count: 2; }
    
    /* THE FIX: Forcing experience grid to a single column */
    .experience-grid { grid-template-columns: 1fr; }
    .exp-card.wide { grid-column: span 1; } /* This overrides the desktop span */
    
    .footer-container { flex-direction: column; text-align: center; }
    .footer-right { text-align: center; }
    .footer-social { justify-content: center; }
    .footer-contact-links { align-items: center; }
}
@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; }
    .bento-item, .exp-card { grid-column: span 1 !important; }
    .form-group-row { flex-direction: column; gap: 0; }
}
@media (max-width: 576px) {
    .intro h1 { font-size: 1.8rem; line-height: 1.3; }
    .gallery-grid { column-count: 1; }
    .caption { font-size: 0.9rem; }
}