/* ============ PROJECT 2: FOOD MAPPING ============ */
:root {
    --accent: #3b82f6;
    --text-muted: #a1a1aa;
    --border: rgba(255, 255, 255, 0.05);
}

/* --- 1. BASE BACKGROUND --- */
html, body {
    overflow-x: hidden; margin: 0; padding: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    background:
        radial-gradient(1200px 600px at 50% 10%, rgba(59, 130, 246, 0.14), transparent 60%),
        radial-gradient(800px 500px at 80% 40%, rgba(34, 211, 238, 0.06), transparent 55%),
        #07070b;
    background-attachment: fixed;
}

/* --- 2. CONTENT CONTAINER --- */
.main__inner { background: rgba(255, 255, 255, 0.02); backdrop-filter: blur(16px); border: 1px solid var(--border); }
.main__inner::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent); }

/* --- 3. TYPOGRAPHY --- */
.pageTitle { font-size: 56px; font-weight: 800; color: #fff; margin-bottom: 12px; line-height: 1.1; }
.pageSub { font-size: 20px; color: var(--text-muted); line-height: 1.6; max-width: 800px; margin-bottom: 40px; }
.eyebrow { color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; font-weight: 600; margin-bottom: 12px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 60px 0; }

/* --- 4. CASE STUDY GRID --- */
.case-study-grid { display: flex; flex-direction: column; gap: 100px; }

/* Desktop Grid */
.case-row { 
    display: grid; 
    grid-template-columns: 1fr 1.2fr; 
    gap: 80px; 
    align-items: center; 
    margin-bottom: 100px; 
}

/* Reverse Row */
.case-row.reverse { grid-template-columns: 1.2fr 1fr; }
.case-row.reverse .case-image { order: 1; }
.case-row.reverse .case-text { order: 2; }

.case-image img { 
    width: 100%; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.08); 
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5); transition: transform 0.5s ease; cursor: zoom-in;
}
.case-image:hover img { transform: scale(1.02); }

.case-text h3 { font-size: 28px; color: #fff; margin-bottom: 20px; }
.case-text p { color: var(--text-muted); line-height: 1.8; font-size: 16px; }

/* --- TECH PILL CAPTION (CLOSER GAP) --- */
.img-caption {
    display: block;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    backdrop-filter: blur(8px);
    width: fit-content;
    margin-left: auto; margin-right: auto;
    letter-spacing: 0.5px;
}

.case-image .img-caption {
     margin-top: 10px;
}

.philosophy-image-side .img-caption {
     margin-top: 20px;
}

/* --- 5. UNIQUE: TECH VISUALS --- */
.project__thumb--technical {
    background: linear-gradient(145deg, #111, #1a1a1a);
    display: flex; align-items: center; justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.tech-stack-visual { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.tech-main { font-family: 'Barlow Condensed', sans-serif; font-size: 24px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.tech-sub { font-size: 11px; color: rgba(255, 255, 255, 0.4); letter-spacing: 2px; text-transform: uppercase; }

/* --- 6. PHILOSOPHY BENTO GRID --- */
.design-philosophy-container { display: flex; flex-direction: row; gap: 60px; align-items: stretch; margin: 80px 0 40px 0; justify-content: center; }
.philosophy-image-side { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.philosophy-text-side { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }

.philo-pillar { background: rgba(255, 255, 255, 0.02); border-radius: 16px; padding: 24px; border: 1px solid var(--border); flex: 1; display: flex; flex-direction: column; justify-content: center; }
.philo-pillar h4 { color: #fff; margin: 0 0 10px 0; font-size: 18px; }
.philo-pillar p { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.design-system-preview-img { width: 100%; height: auto; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.1); }

/* --- 7. FOOTER & BUTTONS --- */
.tech-footer { border-top: 1px solid var(--border); margin-top: 80px; padding-top: 40px; }
.stack-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.stack-pills span { padding: 6px 14px; border-radius: 20px; font-size: 13px; color: var(--text-muted); background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1); }
.project-links { display: flex; gap: 16px; margin-top: 40px; }

/* Fixed Buttons (Black Text) */
a.btn-primary { 
    background: #fff !important; color: #000 !important; 
    padding: 14px 28px; border-radius: 12px; font-weight: 600; display: inline-block; transition: transform 0.2s ease; text-decoration: none; border: none;
}
a.btn-secondary { 
    background: rgba(255, 255, 255, 0.03) !important; color: #fff !important; 
    border: 1px solid var(--border); padding: 14px 28px; border-radius: 12px; font-weight: 600; display: inline-block; text-decoration: none;
}
a.btn-primary:hover, a.btn-secondary:hover { transform: translateY(-2px); }

/* --- 8. IMAGE MODAL --- */
.modal-overlay { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.95); align-items: center; justify-content: center; flex-direction: column; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content { margin: auto; display: block; max-width: 90%; max-height: 85vh; object-fit: contain; border-radius: 8px; box-shadow: 0 0 50px rgba(0,0,0,0.5); animation: zoomIn 0.3s ease; }
@keyframes zoomIn { from {transform:scale(0.9); opacity:0} to {transform:scale(1); opacity:1} }
.modal-close { position: absolute; top: 20px; right: 30px; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; z-index: 10001; }
#modal-caption { margin: 10px auto; display: block; width: 80%; max-width: 700px; text-align: center; color: #ccc; font-size: 14px; padding: 10px 0; }

@media (max-width: 1100px) {
    .main__inner {
      /* THE MARGIN FIX: Centers the entire container on the screen */
      margin: 0px !important;
      margin-top: 70px !important;
      /* margin-left: 10px !important; */
      
      /* Ensures the container fills the available horizontal space correctly */
      width: 100% !important;
      max-width: 1200px !important;

    }
    .pageTitle {
        font-size: 30px !important;
    }
    .pageSub{
        font-size: 16px !important;
    }
    .h3{
        font-size: 20px !important;
    }
    p {
        font-size: 14px !important;
    }
  }
/* --- 9. MOBILE ADJUSTMENTS (TEXT ALWAYS FIRST) --- */
@media (max-width: 1024px) {

    .main__inner { padding: 40px !important; }
    .pageTitle { font-size: 32px; }
    
    /* Stack Case Studies */
    .case-row, .case-row.reverse { grid-template-columns: 1fr; gap: 40px; display: flex; flex-direction: column; }
    
    /* FIX: Force Text First */
    .case-row .case-text, .case-row.reverse .case-text { order: 1; }
    .case-row .case-image, .case-row.reverse .case-image { order: 2; }
    
    /* Philosophy Stack */
    .design-philosophy-container { flex-direction: column !important; gap: 25px; }
    .philosophy-image-side { width: 100%; order: 2; }
    .philosophy-text-side { width: 100%; order: 1; gap: 15px; }
    
    .philo-pillar { padding: 20px; }
    .project-links { flex-direction: column; gap: 12px; }
    .btn-primary, .btn-secondary { text-align: center; width: 100%; box-sizing: border-box; }
}

/* ============ TAGS: FIXED GRID SHELF ============ */
.stack-pills span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* THE FIX: Proper vertical breathing room to stop overlapping */
    padding: 8px 18px !important; 
    min-height: 32px !important;
    
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    border-radius: 8px !important;
    
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    white-space: nowrap;
}

.stack-pills {
    height: auto !important; /* Allow container to wrap pills naturally */
    min-height: 44px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

/* THE FIX: Makes the image behave like the case study images */
.design-system-preview-img {
    cursor: zoom-in !important;
    transition: transform 0.5s ease;
    width: 100% !important;
    height: auto;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.design-system-preview-img:hover {
    transform: scale(1.02);
    border-color: rgba(59, 130, 246, 0.5) !important;
}
