:root {
    --orange: #FF6700;
    --dark-bg: #111111;
    --light-bg: #F9FAFB;
    --text-light: #F9FAFB;
    --text-dark: #1F2937;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    margin: 0;
    color: var(--text-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- PROJECTS SECTION & HEADER --- */
.projects-section {
    padding: 8rem 0 6rem 0;
}
.projects-header {
    text-align: center;
    margin-bottom: 4rem;
}
.projects-header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin: 0 0 1rem 0;
}
.projects-header p {
    font-size: 1.25rem;
    color: #6B7280;
    margin: 0 auto;
    max-width: 60ch;
}

/* --- FILTERS & PROJECT GRID --- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 4rem;
}
.filter-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid #E5E7EB;
    background-color: transparent;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.filter-btn:hover {
    background-color: #F3F4F6;
    border-color: #D1D5DB;
}
.filter-btn.active {
    background-color: var(--text-dark);
    color: var(--text-light);
    border-color: var(--text-dark);
}

/* projects.css (Replace the old project grid styles with this) */

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.project-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background-color: var(--dark-bg);
    height: 480px;
    display: flex;
}

.project-card.full-width {
    grid-column: 1 / -1;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover::after {
    opacity: 1;
}

.project-card:hover img {
    transform: scale(1.05);
}

.card-content {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    padding: 1.5rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Correctly aligns all content to the TOP */
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    /* Animate from slightly above */
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.project-card:hover .card-tags {
    transform: translateY(0);
    opacity: 1;
}

.card-tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    border-radius: 50px;
    color: white;
}

.card-info {
    /* CHANGED: Removed 'margin-top: auto' and added a fixed margin for spacing */
    margin-top: 1rem;
}

.card-info h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: white;
    margin: 0;
    line-height: 1.2;
    /* Animate from slightly above to match the tags */
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.05s; /* Stagger slightly after tags */
}

.project-card:hover .card-info h3 {
    transform: translateY(0);
    opacity: 1;
}


.project-card:hover .card-info h3 {
    transform: translateY(0);
    opacity: 1;
}

/* --- FINAL CTA SECTION --- */
.cta-section {
    background-color: var(--dark-bg);
    color: var(--text-light);
    padding: 8rem 0;
    text-align: center;
}
.cta-section h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin: 0 0 2rem 0;
}
.cta-button {
    background-color: var(--orange);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}
.cta-button:hover {
    transform: scale(1.05);
    filter: brightness(110%);
}

/* ================================== */
/* == FINAL IMMERSIVE POPUP MODAL == */
/* ================================== */
.project-popup-modal {
    position: fixed; top: 0; right: 0; width: 100%; height: 100%;
    z-index: 2000; overflow: hidden; visibility: hidden;
}
.project-popup-modal::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(17, 15, 26, 0.6); backdrop-filter: blur(5px);
    opacity: 0; transition: opacity 0.4s ease;
}
.project-popup-modal.is-open::before { opacity: 1; }
.project-popup-modal.is-open { visibility: visible; }

.modal-content {
    position: absolute; top: 0; right: 0;
    width: 100%; max-width: 95vw; height: 100%;
    background-color: #f9fafb; overflow-y: auto;
    box-shadow: -10px 0 50px -20px rgba(0,0,0,0.3);
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.project-popup-modal.is-open .modal-content { transform: translateX(0); }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 2rem 3rem; border-bottom: 1px solid #e5e7eb;
}
#popup-title { color: var(--orange); font-size: 2rem; margin: 0; }
#popup-category { color: #6b7280; margin: 0; }
.close-modal-btn {
    background: #000000; border: none; width: 40px; height: 40px;
    border-radius: 50%; font-size: 1.5rem; cursor: pointer; transition: all 0.3s;
    color: white;
}
.close-modal-btn:hover {
    background-color: var(--orange); color: black; transform: rotate(90deg);
}

.modal-body { padding: 3rem; }
.modal-hero-image { margin-bottom: 3rem; }
.modal-hero-image img { width: 100%; border-radius: 8px; }

.project-details-container {
    display: grid; grid-template-columns: 2fr 1fr; gap: 3rem;
    margin-bottom: 3rem; border-bottom: 1px solid #e5e7eb; padding-bottom: 3rem;
}
.project-details-column h3 {
    margin-top: 0; font-size: 1.25rem; color: var(--orange);
}
.description-column p { line-height: 1.7; color: #374151; }
.info-column dl { margin: 0; }
.info-column dt { font-weight: 600; color: #111827; margin-bottom: 0.25rem; }
.info-column dd { color: #6b7280; margin: 0 0 1rem 0; }

.popup-gallery h3 { font-size: 1.25rem; color: var(--orange); }
.popup-gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.popup-gallery-grid img { width: 100%; border-radius: 8px; }

/* --- RESPONSIVE STYLES --- */
@media (max-width: 768px) {
    .project-grid { grid-template-columns: 1fr; }
    .project-details-container { grid-template-columns: 1fr; }
    .modal-header, .modal-body { padding: 1.5rem; }
    .modal-content { max-width: 100vw; }
}