/* =========================================
   1. RESET & GLOBAL STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Times New Roman", Times, serif;
    background-color: #FFFFFF;
    width: 100%;
    overflow-x: hidden;
}

/* Link Resets & Hover Effects */
a {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

/* =========================================
   2. DESKTOP TYPOGRAPHY (Default)
   ========================================= */
.h1-text {
    font-family: "Times New Roman", serif;
    font-size: 64px;
    color: #323232;
    font-style: italic;
    font-weight: 400;
    line-height: 1.1;
}

.h2-text {
    font-family: "Times New Roman", serif;
    font-size: 32px;
    color: #9A9A9A;
    font-weight: 400;
    font-style: normal;
    line-height: 1.2;
}

.h3-text {
    font-family: "Times New Roman", serif;
    font-size: 32px;
    color: #323232;
    font-weight: 400;
    font-style: italic;
    line-height: 1.2;
    margin-bottom: 30px; 
}

.h4-text {
    font-family: "Times New Roman", serif;
    font-size: 24px;
    color: #9A9A9A;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4; 
}

.analysis-paragraph {
    text-align: justify;
}

/* =========================================
   3. LAYOUT CONTAINERS
   ========================================= */

/* --- Navigation --- */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 50px 200px 0px 200px;
}

.dot {
    font-size: 20px;
    color: #9A9A9A;
    position: relative;
    top: -2px;
}

/* --- Text Sections --- */
.hero-container, 
.subtitle-container, 
.analysis-container {
    padding: 0px 200px;
    margin-top: 50px;
    width: 100%;
}

.analysis-container {
    margin-top: 100px;
    margin-bottom: 100px;
}

/* --- Two Column Text Layout --- */
.two-col-text {
    display: flex;
    flex-direction: row;
    gap: 50px;
    width: 100%;
    align-items: flex-start;
}

.two-col-text > * {
    flex: 1;
    min-width: 0;
}

.analysis-list {
    padding-left: 20px;
    margin: 0;
}

.analysis-list li {
    margin-bottom: 20px;
}

/* --- Full Width Image --- */
.full-image-container {
    padding: 0px 10px;
    margin-top: 50px;
    width: 100%;
}

.wide-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
    border: 1px solid #9A9A9A;
}

/* --- 4-Image Gallery --- */
.gallery-container {
    display: flex;
    gap: 10px;
    padding: 0px 10px;
    margin-top: 100px; 
    width: 100%;
}

.gallery-img {
    flex: 1;
    min-width: 0;
    height: auto;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid #9A9A9A;
    display: block;
}

/* --- 2x2 Grid Gallery --- */
.grid-gallery-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0px 10px;
    margin-top: 100px; 
    width: 100%;
}

.grid-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid #9A9A9A;
}

/* --- Project Index Link (Home Page) --- */
.project-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    
    /* Desktop Padding: 10px Left/Right */
    padding: 0px 10px; 
    
    margin-top: 50px;
    width: 100%;
    overflow: hidden;
}

.image-group-link {
    display: flex;
    gap: 10px; /* Gap for Desktop */
    flex: 1;
    min-width: 0;
    align-self: stretch;
}

.app-screen {
    flex: 1;
    min-width: 0;
    height: auto;
    object-fit: contain;
    border-radius: 20px;
    border: 1px solid #9A9A9A;
    display: block;
}

.title-link {
    /* Desktop Margins: 50px Left/Right */
    margin-left: 50px;
    margin-right: 50px;
    flex-shrink: 0;
}

/* --- Footer --- */
.footer-container {
    padding: 0px 200px 50px 200px;
    margin-top: 50px; 
    width: 100%;
}

.footer-line {
    width: 100%;
    height: 1px;
    background-color: #9A9A9A;
    margin-bottom: 30px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap; 
}

/* Utility: Pushes "Home" link to the far right on Desktop */
.back-link {
    margin-left: auto;
}

/* =========================================
   4. RESPONSIVE (TABLET & MOBILE)
   ========================================= */

/* We apply the "Mobile Layout" (Stacking, Fonts, Hidden Images) 
   starting at 1024px (Tablet). 
*/
@media (max-width: 1024px) {
    
    /* 1. TYPOGRAPHY UPDATES */
    .h1-text {
        font-size: 40px; 
        color: #323232;
        font-style: italic;
    }
    
    .h2-text {
        font-size: 24px;
        color: #9A9A9A;
        font-style: normal;
    }
    
    .h3-text {
        font-size: 24px;
        color: #9A9A9A;
        font-style: italic;
    }
    
    .h4-text {
        font-size: 16px; 
        color: #9A9A9A;
        font-style: normal;
    }
    
    .dot {
        font-size: 14px;
        top: -1px;
    }

    /* 2. TABLET PADDING (100px) */
    .nav-container { 
        padding: 30px 100px 0px 100px; 
    }
    
    .hero-container, 
    .subtitle-container { 
        padding: 0px 100px; 
        margin-top: 30px; 
    }
    
    .analysis-container { 
        padding: 0px 100px; 
        margin-top: 50px; 
        margin-bottom: 50px; 
    }
    
    .footer-container { 
        padding: 0px 100px 50px 100px; 
    }

    /* Reset Back Link to Left */
    .back-link {
        margin-left: 0;
    }
    
    /* 3. PROJECT CONTAINER (Stacking & Hiding) */
    .project-container {
        flex-direction: column; 
        align-items: flex-end; 
        
        /* Padding: 10px Left/Right */
        padding: 0px 10px; 
        
        gap: 20px;
    }
    
    .title-link { 
        /* Margins: 50px Left/Right */
        margin-left: 50px; 
        margin-right: 50px;
        
        margin-top: 10px; 
        margin-bottom: 20px; 
        align-self: flex-end; 
    }

    .image-group-link { 
        width: 100%; 
        /* Removed justify-content: space-between to allow gap: 10px to work properly */
        justify-content: center;
    }
    
    /* Hide First Image */
    .image-group-link .app-screen:first-child {
        display: none;
    }

    /* Resize Remaining Images: 50% minus half the 10px gap */
    .app-screen { 
        width: calc(50% - 5px);
        max-width: none;
        flex: 0 0 auto; /* Ensures flexbox respects the calculated width */
    }

    /* 4. LAYOUT STACKING */
    /* Two Column Text -> Stacked */
    .two-col-text {
        flex-direction: column;
        gap: 30px;
    }
    .analysis-list { padding-left: 15px; }

    /* Gallery Grids -> Stacked */
    .gallery-container { flex-wrap: wrap; }
    .gallery-img { flex: 1 1 calc(50% - 10px); min-width: 150px; }

    .grid-gallery-container {
        grid-template-columns: 1fr;
    }

    /* 5. IMAGE BORDER RADIUS (10px) */
    .wide-img, 
    .gallery-img, 
    .grid-img, 
    .app-screen {
        border-radius: 10px;
    }

    /* Keep Images Full Width (10px padding) */
    .full-image-container, 
    .gallery-container, 
    .grid-gallery-container { 
        padding: 0px 10px; 
    }
}

/* MOBILE SPECIFIC OVERRIDES 
   This just updates the padding to 50px for smaller screens 
*/
@media (max-width: 768px) {
    /* MOBILE PADDING (50px) */
    .nav-container { 
        padding: 30px 50px 0px 50px; 
    }
    
    .hero-container, 
    .subtitle-container { 
        padding: 0px 50px; 
    }
    
    .analysis-container { 
        padding: 0px 50px; 
    }
    
    .footer-container { 
        padding: 0px 50px 50px 50px; 
    }
}