/* ==========================================================================
   1. CORE GLOBAL ARCHITECTURE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #333333; /* Master Warm Charcoal */
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ==========================================================================
   2. MAIN SITE NAVIGATION TRACK
   ========================================================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.logo-container .site-logo {
    height: 40px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-item {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: #ffffff;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 1.5rem;
}

.social-icons a,
.footer-social-row a {
    color: rgba(255, 255, 255, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.social-icons a:hover,
.footer-social-row a:hover {
    color: #ffffff;
}

.social-icons svg,
.footer-social-row svg {
    width: 20px;
    height: 20px;
    display: block;
}

.menu-toggle-cb,
.hamburger-bars {
    display: none;
}

/* ==========================================================================
   3. MAIN HOMEPAGE HERO CONTAINER
   ========================================================================== */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 2.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.cta-button {
    display: inline-block;
    background-color: #52b1e1;
    color: #ffffff;
    padding: 0.9rem 2.5rem;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.cta-button:hover {
    background-color: #3b99c9;
}

/* ==========================================================================
   4. HOMEPAGE INTRO TEXT BLOCK
   ========================================================================== */
.editorial-intro-section {
    padding: 8rem 5% 7rem 5%;
    background-color: #333333;
}

.editorial-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

.body-highlight {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

.body-subtext {
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
}

/* ==========================================================================
   5. HOMEPAGE PORTFOLIO GRID SHOWCASE
   ========================================================================== */
.showcase-grid-section {
    padding: 0 4% 8rem 4%;
    max-width: 1600px;
    margin: 0 auto;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 6px;
    background-color: #2b2b2b;
}

.grid-card.feature-wide {
    grid-column: span 2;
    aspect-ratio: 21 / 9;
}

.grid-card a {
    display: block;
    width: 100%;
    height: 100%;
}

.grid-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(40, 41, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 2rem;
    transition: background-color 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.card-overlay h2 {
    color: #ffffff !important;
    font-size: 3.2rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.5px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.grid-card:hover img {
    transform: scale(1.03); 
}

.grid-card:hover .card-overlay {
    background-color: rgba(40, 41, 42, 0); 
}

.grid-card:hover .card-overlay h2 {
    opacity: 0;
}

/* ==========================================================================
   6. SUB-PAGE LAYOUT ENGINE & CASE STUDY BLOCKS
   ========================================================================== */
.case-study-engine {
    background-color: #eef2f5; 
    width: 100%;
    position: relative;
}

/* Project Base Structural Layouts (Foundational additions) */
.project-main-content {
    background-color: #333333;
    width: 100%;
}

.project-hero {
    position: relative;
    width: 100%;
    height: 65vh;
    overflow: hidden;
}

.project-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(51,51,51,1));
    z-index: 2;
}

.project-title-block {
    position: absolute;
    bottom: 3rem;
    left: 5%;
    z-index: 10;
}

.project-category {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #52b1e1;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.project-title-block h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.project-editorial-section {
    padding: 5rem 5%;
    background-color: #333333;
}

.project-editorial-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 5rem;
}

.section-mini-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.project-body-text {
    font-size: 1.15rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

.editorial-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.meta-item h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.4rem;
}

.meta-item p {
    font-size: 1.1rem;
    color: #ffffff;
}

.project-gallery-section {
    padding: 0 5% 6rem 5%;
    background-color: #333333;
}

.gallery-stack {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.gallery-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.project-footer-nav {
    padding: 4rem 5%;
    background-color: #2b2b2b;
    display: flex;
    justify-content: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #52b1e1;
}

.back-link svg {
    transition: transform 0.2s ease;
}

.back-link:hover svg {
    transform: translateX(-4px);
}

/* Legacy Subpage Parallax Elements */
.case-hero-parallax {
    position: relative;
    width: 100%;
    height: 55vw; 
    max-height: 75vh; 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #333333;
}

.case-hero-parallax::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.case-editorial-intro {
    padding: 7rem 8% 6rem 8%;
    background-color: #ffffff; 
    position: relative;
    z-index: 5;
}

.editorial-split-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 5.5fr 4.5fr;
    gap: 7rem;
    align-items: start;
}

.case-study-engine .editorial-split-container h1 {
    font-size: 3.2rem;
    font-weight: 500;
    line-height: 1.15;
    color: #000000;
    letter-spacing: -1px;
}

.case-study-engine .split-right-prose p {
    font-size: 1.15rem;
    line-height: 1.65;
    color: #333333;
}

.case-study-engine .split-right-prose strong {
    color: #000000;
    font-weight: 700;
}

.case-mockup-gallery {
    padding: 6rem 8% 4rem 8%;
    background-color: #eef2f5;
    display: flex;
    flex-direction: column;
    gap: 5rem;
    position: relative;
    z-index: 5;
}

.gallery-showcase-frame {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    border-radius: 4px;
    overflow: hidden;
}

.gallery-showcase-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.mg-staggered-row {
    width: 100%;
    position: relative;
    z-index: 5;
}

.mg-staggered-row.light-block {
    background-color: #ffffff;
    padding: 6rem 8%;
}

.mg-staggered-row.dark-block {
    background-color: #28292a; 
    padding: 7rem 8%;
    color: #ffffff;
}

.staggered-row-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

.staggered-row-container.alternative-row-flow {
    grid-template-columns: 1fr 1fr;
}

.row-text-column h2 {
    font-size: 3.2rem;
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 2rem;
    letter-spacing: -1px;
}

.light-block .row-text-column h2 { color: #000000; }
.light-block .row-text-column p { color: #333333; }

.dark-block .row-text-column h2.cyan-accent-title {
    color: #52b1e1; 
}

.row-text-column p {
    font-size: 1.15rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.row-text-column p:last-child {
    margin-bottom: 0;
}

.row-text-column p.meta-notice-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1.5rem;
}

.video-responsive-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000000;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.video-responsive-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.coming-soon-canvas {
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon-block {
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.15);
}

.placeholder-icon-block svg {
    width: 100%;
    height: 100%;
}

.case-pagination-track {
    padding: 6rem 8% 7rem 8%;
    background-color: #ffffff;
    display: flex;
    justify-content: flex-end; 
    position: relative;
    z-index: 5;
    width: 100%;
}

.case-pagination-track.dual-links {
    justify-content: space-between; 
    align-items: center;
}

.case-study-engine .next-project-link,
.case-study-engine .prev-project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #000000;
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 400;
    transition: opacity 0.2s ease;
}

.case-study-engine .next-project-link svg,
.case-study-engine .prev-project-link svg {
    width: 24px;
    height: 24px;
    color: #000000;
    transition: transform 0.2s ease;
    display: block;
}

.case-study-engine .next-project-link:hover,
.case-study-engine .prev-project-link:hover {
    opacity: 0.6;
}

.case-study-engine .next-project-link:hover svg {
    transform: translateX(6px); 
}

.case-study-engine .prev-project-link:hover svg {
    transform: translateX(-6px); 
}

/* ==========================================================================
   7. MAIN BRAND FOOTER
   ========================================================================== */
.main-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2.5rem;
    padding: 6rem 5% 4rem 5%;
    background-color: #333333; 
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 10;
    width: 100%;
}

.footer-social-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.footer-logo-block {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.footer-logo-block .footer-logo {
    height: 48px;
    width: auto;
    display: block;
}

.footer-attribution-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.attribution-text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.3px;
    line-height: 1.5;
    max-width: 600px;
}

.copyright-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
}

/* ==========================================================================
   8. STABLE RESPONSIVE ARCHITECTURE
   ========================================================================== */
@media (max-width: 1024px) {
    .card-overlay h2 { font-size: 2.2rem; }
    .body-highlight { font-size: 1.8rem; }
    .body-subtext { font-size: 1.2rem; }
    .hero-content h1 { font-size: 2.8rem; }
    
    .editorial-split-container { grid-template-columns: 1fr; gap: 2.5rem; }
    .case-study-engine .editorial-split-container h1 { font-size: 2.4rem; }
    .case-hero-parallax { height: 60vh; background-attachment: scroll; }

    .staggered-row-container, .staggered-row-container.alternative-row-flow {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }
    .row-text-column h2 { font-size: 2.4rem; }
    
    .project-title-block h1 { font-size: 2.5rem; }
    .project-editorial-grid { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 768px) {
    .hamburger-bars {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        cursor: pointer;
        z-index: 2000;
    }

    .hamburger-bars span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #ffffff;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .case-study-engine .hamburger-bars span {
        background-color: #000000;
    }
    
    .case-study-engine .menu-toggle-cb:checked ~ .hamburger-bars span {
        background-color: #ffffff;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%; 
        width: 280px;
        height: 100vh;
        background-color: #222222; 
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 6rem 2.5rem 2rem 2.5rem;
        gap: 2rem;
        z-index: 1500;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
        transition: right 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .menu-toggle-cb:checked ~ .nav-menu {
        right: 0;
    }

    .menu-toggle-cb:checked ~ .hamburger-bars span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background-color: #ffffff;
    }
    .menu-toggle-cb:checked ~ .hamburger-bars span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle-cb:checked ~ .hamburger-bars span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        background-color: #ffffff;
    }

    .social-icons {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .gallery-split {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   9. GLOBAL BACK TO TOP BUTTON MODULE
   ========================================================================== */
.back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    background-color: #52b1e1;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background-color: #3b99c9;
}

.back-to-top-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}

@media (max-width: 768px) {
    .back-to-top-btn {
        bottom: 50px !important; /* Forces the button up above the Firefox toolbar */
        z-index: 99999 !important; /* Guarantees it stays on top of the layout */
    }
}