/* --- Global Styles --- */
:root {
    --text-dark: #1a1a1a;
    --text-light: #888888;
    --bg-color: #ffffff;
    --nav-inactive: rgba(0, 0, 0, 0.3);
    --nav-active: #000000;
}

html { scroll-behavior: smooth; }

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0; padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    /* overflow-x: hidden is purposefully omitted here so sticky nav works! */
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.5px; margin-top: 0; }
h1 { font-size: 3.5rem; margin-bottom: 0.5rem; }
h2 { font-size: 2.5rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.8rem; margin-bottom: 1rem; }
p { font-size: 1.1rem; margin-bottom: 1.5rem; color: #444; }
.intro-text { margin-top: 0; } 
ul { margin-bottom: 1.5rem; padding-left: 20px; color: #444; }
li { margin-bottom: 0.5rem; }

/* --- Top Navigation Bar --- */
.top-nav-bar {
    padding: 20px 5%;
    position: absolute;
    top: 0; left: 0;
    z-index: 10;
    width: 100%;
}

.back-link {
    text-decoration: none;
    color: #333; /* Dark text since background is likely light */
    font-weight: 600;
    display: inline-block;
    transition: opacity 0.2s;
    background: rgba(255,255,255,0.5); /* Light pill background */
    padding: 8px 16px;
    border-radius: 30px;
}
.back-link:hover { opacity: 0.8; }

/* --- HERO & BACKGROUND --- */
.bg-hero {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 60vh;
    background-size: cover; background-position: center;
    z-index: -1; 
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.project-header {
    padding: 120px 0 40px; 
    max-width: 1200px;
    margin: 0 auto;
    width: 90%;
}

.role-details {
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 500;
}

.hero-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 80px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

/* --- Main Layout Container --- */
.case-study-container {
    display: flex;
    width: 90%; 
    max-width: 1200px;
    margin: 0 auto; 
    position: relative;
    gap: 60px; 
}

.content-area {
    flex: 1; 
    padding-bottom: 100px;
}

/* --- Sticky Navigation --- */
.sticky-nav-container {
    width: 250px; 
    flex-shrink: 0; 
    position: relative; 
}

.jump-links {
    position: sticky;
    top: 150px; 
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-right: 20px;
    text-align: right;
}

.nav-link {
    text-decoration: none;
    color: var(--nav-inactive);
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.nav-link:hover { color: var(--text-light); }
.nav-link.active {
    color: var(--nav-active);
    font-weight: 700;
    font-size: 1.2rem;
}
.nav-link.active::after {
    content: ''; display: inline-block; width: 8px; height: 8px;
    background-color: var(--nav-active); border-radius: 50%; margin-left: 15px;
}

/* --- Zigzag Content Blocks --- */
.zigzag-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px; 
    align-items: start; 
    margin-bottom: 150px;
    border-top: 1px solid #eee;
    padding-top: 60px;
    width: 100%;
}

.zigzag-block:first-child { border-top: none; padding-top: 0; }

.zigzag-block:nth-child(even) .text-content { order: 2; }
.zigzag-block:nth-child(even) .image-content { order: 1; }

.text-content { padding: 0; }

.image-content img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    display: block; /* Prevents tiny gaps under images */
}

.tall-mockup {
    object-fit: cover;
    aspect-ratio: 9 / 16;
}

/* --- Layout Variations --- */
.full-width-block { margin-bottom: 120px; width: 100%; }
.landscape-image {
    width: 100%; height: 550px;
    object-fit: cover;
    border-radius: 12px; margin-bottom: 50px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}
.text-center-wrapper { text-align: center; max-width: 700px; margin: 0 auto; }
.pb-large { padding-bottom: 150px; }

/* =========================================
   FOOTER STYLES
   ========================================= */

.site-footer {
    background-color: #fafafa; /* Slight off-white to separate it from the main content */
    border-top: 1px solid #eaeaea;
    padding: 80px 5% 40px;
    margin-top: 100px; /* Pushes it down from the case study content */
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows stacking on smaller screens */
    gap: 40px;
    margin-bottom: 60px;
}

.footer-left h3 {
    margin-bottom: 10px;
    font-size: 2rem;
}

.footer-left p {
    color: var(--text-light);
    margin-bottom: 25px;
    max-width: 400px;
}

/* =========================================
   FOOTER ICON FIXES
   ========================================= */

.social-links {
    display: flex;
    gap: 15px; /* Space between the circles */
}

/* Creates the dark circle behind your white icons */
.circle-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;          /* Fixed width of the circle */
    height: 45px;         /* Fixed height of the circle */
    background-color: var(--text-dark); /* Dark background so white icons show */
    border-radius: 50%;   /* Makes it a perfect circle */
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Forces the images to be small and perfectly identically sized */
.circle-icon img {
    width: 20px;          /* Exact width of the icon inside */
    height: 20px;         /* Exact height of the icon inside */
    object-fit: contain;  /* Prevents the image from stretching */
}

/* Fun hover effect */
.circle-icon:hover {
    transform: translateY(-5px); /* Bounces up slightly */
    background-color: #555;      /* Gets slightly lighter */
}


/* =========================================
   STICKY BACK TO TOP BUTTON
   ========================================= */

.floating-back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background-color: #f8f9fa; /* Clean, light grey */
    color: #333; /* Dark grey arrow */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* Soft drop shadow */
    z-index: 2000;
    
    /* Animation for hovering and appearing */
    transition: all 0.3s ease;
    
    /* Hidden by default (Javascript will reveal it) */
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px); 
}

/* When the 'show' class is added by JS */
.floating-back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.floating-back-to-top:hover {
    background-color: #e9ecef; /* Slightly darker grey on hover */
    transform: translateY(-5px); /* Bounces up slightly */
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Mobile Adjustments */
@media screen and (max-width: 768px) {
    .floating-back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Mobile fix for Back to Top */
@media screen and (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* Next Project Button styling */
.next-project-link {
    display: block;
    text-decoration: none;
    text-align: right;
    padding: 30px 40px;
    background-color: var(--bg-color); /* White */
    border: 1px solid #eaeaea;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.next-project-link:hover {
    transform: translateY(-5px); /* Moves up slightly */
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.next-project-link span {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.next-project-link h4 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin: 0;
}

/* Bottom Copyright area */
.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    border-top: 1px solid #eaeaea;
    padding-top: 30px;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-light);
}

/* Mobile Responsive Adjustments */
@media screen and (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .next-project-link {
        text-align: left;
        width: 100%; /* Makes the button full width on phones */
    }
}


/* --- Mobile Responsive (RWD) --- */
@media screen and (max-width: 900px) {
    h1 { font-size: 2.5rem; }
    
    .project-header { padding: 80px 0 30px; }
    .hero-img { height: 250px; margin-bottom: 40px; }

    /* Hide side nav, make content full width */
    .sticky-nav-container { display: none; }
    .case-study-container { display: block; width: 90%; gap: 0; }
    .content-area { padding-bottom: 60px; }

    /* Stack Zigzag blocks */
    .zigzag-block {
        grid-template-columns: 1fr;
        gap: 40px; margin-bottom: 100px;
        padding-top: 40px;
    }
    
    .zigzag-block:nth-child(even) .text-content { order: 0; }
    .zigzag-block:nth-child(even) .image-content { order: 0; }

    .tall-mockup { aspect-ratio: auto; max-height: 500px; }
    .landscape-image { height: 300px; }
    
    .top-nav-bar { position: relative; padding: 15px 5%; }
    .back-link { background: rgba(0,0,0,0.05); }
}
