/* ==========================================================================
   Projects Detail Page Styles
   Mobile-first responsive design with modern aesthetics
   ========================================================================== */

/* ==========================================================================
   1. BASE STYLES
   ========================================================================== */
body {
    background: #0f0f0f;
    color: #fff;
}

/* ==========================================================================
   2. NAVIGATION - MOBILE FIRST DESIGN
   ========================================================================== */

/* ---------- Base Navigation Bar ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    height: 56px;
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Navigation Wrapper ---------- */
.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-width: 100%;
    gap: 2rem;
}

/* ---------- Back Link ---------- */
.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: transparent;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-link:hover,
.back-link:active {
    background: rgba(255, 255, 255, 0.05);
}

.back-link svg {
    width: 20px;
    height: 20px;
}

.back-link span {
    display: none;
}

/* ---------- Project Navigation ---------- */
.project-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 0.5rem;
    color: rgba(145, 255, 0, 0.7); /* Debug color */
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn svg {
    width: 16px;
    height: 16px;
}

/* ---------- Project Counter ---------- */
.project-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.current-project {
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
}

/* ---------- Language Switcher ---------- */
.language-switcher {
    display: flex;
    padding: 0.125rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.375rem;
}

.language-switcher .lang-btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: 0.25rem;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-switcher .lang-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.language-switcher .lang-btn:not(.active):hover {
    color: rgba(255, 255, 255, 0.9);
}

/* ---------- Very Small Screens (360px and below) ---------- */
@media (max-width: 480px) {
    .navbar {
        height: 52px;
    }
}

/* ---------- Larger Mobile (480px to 768px) ---------- */
@media (min-width: 481px) and (max-width: 768px) {
    .navbar {
        height: 64px;
    }

}

/* ---------- Tablet and Desktop (768px and above) ---------- */
@media (min-width: 768px) {
    .navbar {
        position: sticky;
        height: auto;
    }

    .nav-wrapper {
        max-width: 1200px;
        margin: 0 auto;
    }

    /* Desktop Back Link */
    .back-link {
        width: auto;
        height: auto;
        padding: 0.625rem 1rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 0.5rem;
        gap: 0.5rem;
    }

    .back-link span {
        display: inline;
        font-size: 0.875rem;
        font-weight: 500;
    }

    .back-link:hover {
        background: rgba(255, 255, 255, 0.1);
    }

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

    /* Desktop Project Navigation */
    .project-nav {
        flex: 0 0 auto;
        gap: 0.75rem;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .nav-btn:hover:not(:disabled) {
        transform: scale(1.05);
        background: rgba(255, 255, 255, 0.15);
    }

    .project-counter {
        padding: 0;
        font-size: 0.875rem;
    }

    /* Desktop Language Switcher */
    .language-switcher {
        background: transparent;
        padding: 0;
        gap: 0.375rem;
    }

    .language-switcher .lang-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0.375rem;
    }

    .language-switcher .lang-btn.active {
        background: #2563eb;
        border-color: #2563eb;
    }

    .language-switcher .lang-btn:not(.active):hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ==========================================================================
   3. LOADING STATE
   ========================================================================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   4. HERO SECTION - MOBILE FIRST
   ========================================================================== */
.project-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    max-height: 500px;
    margin-top: 56px; /* Account for fixed navbar */
    overflow: hidden;
}

/* Tablet */
@media (min-width: 768px) {
    .project-hero {
        margin-top: 0; /* Account for desktop navbar height */
        height: 70vh;
        min-height: 500px;
        max-height: 600px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .project-hero {
        height: 80vh;
        min-height: 600px;
        max-height: 800px;
    }
}

.hero-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

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

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.3) 30%,
        rgba(0,0,0,0.6) 60%,
        rgba(0,0,0,0.9) 100%);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1.25rem;
    padding-bottom: env(safe-area-inset-bottom, 1.5rem);
    z-index: 1;
    background: linear-gradient(to top,
        rgba(0,0,0,0.95) 0%,
        rgba(0,0,0,0.7) 50%,
        transparent 100%);
}

/* Small mobile optimization */
@media (min-width: 375px) {
    .hero-content {
        padding: 1.75rem 1.5rem;
        padding-bottom: env(safe-area-inset-bottom, 1.75rem);
    }

    .project-badge {
        padding: 0.375rem 0.875rem;
        font-size: 0.625rem;
        margin-bottom: 1rem;
    }
}

@media (min-width: 768px) {
    .hero-content {
        padding: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .hero-content {
        padding: 3rem;
        max-width: 1200px;
        margin: 0 auto;
    }
}

.project-badge {
    display: inline-block;
    padding: 0.3125rem 0.75rem;
    margin-bottom: 1rem;
    background: rgba(37, 99, 235, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
}

.project-title {
    margin-bottom: 0.75rem;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.15;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8),
                 0 1px 3px rgba(0, 0, 0, 0.9);
    word-break: break-word;
    max-width: 100%;
}

@media (min-width: 375px) {
    .project-title {
        font-size: 1.625rem;
        margin-bottom: 0.75rem;
    }
}

@media (min-width: 414px) {
    .project-title {
        font-size: 1.75rem;
    }
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
    flex-wrap: wrap;
}

.project-meta .location,
.project-meta .year {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.375rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    font-weight: 500;
}

.project-meta svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

@media (min-width: 768px) {
    .project-badge {
        padding: 0.5rem 1rem;
        font-size: 0.6875rem;
        margin-bottom: 1rem;
        background: #2563eb;
        border: none;
    }

    .project-title {
        font-size: 2.25rem;
        margin-bottom: 1rem;
        line-height: 1.2;
    }

    .project-meta {
        font-size: 0.875rem;
        gap: 1rem;
    }

    .project-meta .location,
    .project-meta .year {
        padding: 0.25rem 0.5rem;
    }

    .project-meta svg {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 1024px) {
    .project-title {
        font-size: 3rem;
        margin-bottom: 1.25rem;
    }

    .project-badge {
        padding: 0.5rem 1.125rem;
        font-size: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .project-meta {
        gap: 1.5rem;
        font-size: 0.9375rem;
    }
}

/* ==========================================================================
   5. PROJECT DETAILS - MOBILE FIRST
   ========================================================================== */
.project-details {
    padding: 1.5rem 0;
    background: #0f0f0f;
}

@media (min-width: 768px) {
    .project-details {
        padding: 3rem 0;
    }
}

.details-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .details-grid {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .details-grid {
        gap: 3rem;
    }
}

/* ---------- Main Content - Mobile Optimized ---------- */
.main-content {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
    .main-content {
        padding: 2rem;
        border-radius: 1rem;
    }
}

.content-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.content-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.content-section h2 {
    margin-bottom: 0.875rem;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.content-section p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    line-height: 1.65;
    letter-spacing: 0.01em;
}

@media (min-width: 768px) {
    .content-section {
        margin-bottom: 2.5rem;
    }

    .content-section h2 {
        margin-bottom: 1rem;
        font-size: 1.5rem;
    }

    .content-section p {
        font-size: 1rem;
        line-height: 1.8;
    }
}

/* ---------- Services List ---------- */
.services-list {
    list-style: none;
    padding: 0;
}

.services-list li {
    position: relative;
    padding: 0.5rem 0 0.5rem 2rem;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.services-list li:active {
    background: rgba(255, 255, 255, 0.05);
}

.services-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #2563eb;
    font-weight: bold;
    font-size: 1.125rem;
}

@media (min-width: 768px) {
    .services-list li {
        padding-left: 2rem;
        margin-bottom: 0.75rem;
        font-size: 1rem;
    }

    .services-list li::before {
        font-size: 1.2rem;
    }
}

/* ---------- Technical Specs ---------- */
.tech-specs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.tech-specs > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.875rem;
    min-height: 44px; /* Touch target */
}

.tech-specs > div span:first-child {
    color: rgba(255, 255, 255, 0.6);
}

.tech-specs > div strong {
    color: #fff;
    font-weight: 600;
}

.tech-specs > div:last-child {
    border-bottom: none;
}

@media (min-width: 768px) {
    .tech-specs {
        gap: 1rem;
    }

    .tech-specs > div {
        padding: 0.75rem 0;
        font-size: 1rem;
    }
}

/* ---------- Sidebar - Mobile First ---------- */
.project-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    order: -1; /* Show before main content on mobile */
}

@media (min-width: 768px) {
    .project-sidebar {
        order: 0; /* Reset order on desktop */
    }
}

@media (min-width: 768px) {
    .project-sidebar {
        gap: 2rem;
    }
}

.quick-facts {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
    .quick-facts {
        padding: 1.5rem;
        border-radius: 1rem;
    }
}

.quick-facts h3 {
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

@media (min-width: 768px) {
    .quick-facts h3 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }
}

.facts-list {
    display: grid;
    gap: 0.875rem;
}

@media (min-width: 768px) {
    .facts-list {
        gap: 1rem;
    }
}

.facts-list dt {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.facts-list dd {
    font-size: 1rem;
    color: #fff;
    margin: 0 0 0.75rem 0;
    font-weight: 600;
}

.facts-list dd:last-child {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .facts-list dt {
        font-size: 0.875rem;
    }

    .facts-list dd {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}

/* ---------- Project Tags ---------- */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.project-tags span {
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.project-tags span:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .project-tags {
        gap: 0.5rem;
    }

    .project-tags span {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   6. GALLERY SECTION - MOBILE OPTIMIZED
   ========================================================================== */
.project-gallery {
    padding: 1.5rem 0;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

@media (min-width: 768px) {
    .project-gallery {
        padding: 3rem 0;
    }
}

.gallery-header {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .gallery-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
}

.gallery-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .gallery-header h2 {
        font-size: 1.75rem;
    }
}

/* ---------- Gallery Filters - Mobile Scrollable ---------- */
.gallery-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-filters::-webkit-scrollbar {
    display: none;
}

.gallery-filter {
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .gallery-filter:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
}

.gallery-filter:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.15);
}

.gallery-filter.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

@media (min-width: 768px) {
    .gallery-filters {
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .gallery-filter {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* ---------- Gallery Layout - Mobile Optimized Grid ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

@media (min-width: 375px) {
    .gallery-grid {
        gap: 0.75rem;
    }
}

@media (min-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
        margin-bottom: 2rem;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (min-width: 1280px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

.gallery-masonry {
    column-count: 2;
    column-gap: 0.5rem;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .gallery-masonry {
        column-count: 3;
        column-gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .gallery-masonry {
        column-count: 4;
        column-gap: 1.25rem;
    }
}

@media (min-width: 1440px) {
    .gallery-masonry {
        column-count: 5;
    }
}

/* ---------- Gallery View Toggle ---------- */
.gallery-view-toggle {
    display: none;
}

@media (min-width: 768px) {
    .gallery-view-toggle {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
    }
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.view-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* ==========================================================================
   7. RELATED PROJECTS - MOBILE HORIZONTAL SCROLL
   ========================================================================== */
.related-projects {
    padding: 1.5rem 0;
    background: #0f0f0f;
    overflow: hidden;
}

@media (min-width: 768px) {
    .related-projects {
        padding: 3rem 0;
    }
}

.related-projects h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding: 0 1rem;
    color: #fff;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .related-projects h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
}

/* Mobile horizontal scroll */
.related-grid {
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
}

.related-grid::-webkit-scrollbar {
    display: none;
}

.related-grid .related-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .related-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0;
        overflow: visible;
    }

    .related-grid .related-card {
        flex: none;
    }
}

@media (min-width: 1024px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* ==========================================================================
   8. PROJECT CTA - MOBILE OPTIMIZED
   ========================================================================== */
.project-cta {
    padding: 2.5rem 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.05));
    text-align: center;
}

@media (min-width: 768px) {
    .project-cta {
        padding: 4rem 0;
    }
}

.cta-content h2 {
    margin-bottom: 0.625rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.cta-content p {
    margin-bottom: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .cta-content h2 {
        margin-bottom: 1rem;
        font-size: 2rem;
    }

    .cta-content p {
        margin-bottom: 2rem;
        font-size: 1.125rem;
    }
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    min-height: 48px;
    background: #2563eb;
    border-radius: 0.625rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .btn-primary:hover {
        background: #1d4ed8;
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
    }
}

.btn-primary:active {
    transform: scale(0.98);
    background: #1d4ed8;
}

@media (min-width: 768px) {
    .btn-primary {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

/* ==========================================================================
   9. BOTTOM SHEET (MOBILE)
   ========================================================================== */
.bottom-sheet {
    display: none;
}

@media (max-width: 768px) {
    .bottom-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #1a1a1a;
        border-radius: 1.5rem 1.5rem 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 900;
        display: block;
    }

    .bottom-sheet.active {
        transform: translateY(0);
    }

    .sheet-handle {
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        margin: 1rem auto;
    }

    .sheet-content {
        padding: 0 1.5rem 1.5rem;
        max-height: 50vh;
        overflow-y: auto;
    }
}

/* ==========================================================================
   10. PLATFORM SPECIFIC
   ========================================================================== */

/* iOS Safe Area Support */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar {
        padding-top: env(safe-area-inset-top);
    }

    @media (max-width: 768px) {
        .bottom-sheet {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* Smooth Scrolling */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* All touch targets minimum 44x44px */
    .nav-btn,
    .gallery-filter,
    .view-btn,
    .btn-primary,
    .project-tags span,
    .related-card {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Smooth scrolling for touch */
    .gallery-filters,
    .related-grid {
        scroll-behavior: smooth;
    }

    /* Visual feedback on touch */
    .gallery-item:active,
    .related-card:active {
        opacity: 0.9;
        transform: scale(0.98);
    }
}

/* ---------- Container Utility - Mobile First ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

@media (min-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* ==========================================================================
   11. MOBILE ENHANCEMENTS & INDICATORS
   ========================================================================== */

/* Horizontal scroll indicators */
.gallery-filters::after,
.related-grid::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2rem;
    background: linear-gradient(to right, transparent, #0f0f0f);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.gallery-filters::before,
.related-grid::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2rem;
    background: linear-gradient(to left, transparent, #0f0f0f);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-filters,
.related-grid {
    position: relative;
}

/* Hide scroll indicators on desktop */
@media (min-width: 768px) {
    .gallery-filters::before,
    .gallery-filters::after,
    .related-grid::before,
    .related-grid::after {
        display: none;
    }
}

/* Pull to refresh hint */
@media (max-width: 768px) {
    .project-hero::after {
        content: 'Swipe for more photos ↓';
        position: absolute;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.5);
        animation: fadeInOut 3s ease-in-out;
        pointer-events: none;
    }

    @keyframes fadeInOut {
        0%, 100% { opacity: 0; }
        50% { opacity: 1; }
    }
}

/* Improved mobile card hover states */
@media (hover: none) {
    .related-card {
        position: relative;
        overflow: hidden;
    }

    .related-card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(circle at var(--x, 50%) var(--y, 50%),
                    rgba(255, 255, 255, 0.1) 0%,
                    transparent 70%);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .related-card:active::after {
        opacity: 1;
    }
}

/* Smooth momentum scrolling */
.gallery-filters,
.related-grid,
.sheet-content {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Bottom sheet improved grab handle */
@media (max-width: 768px) {
    .sheet-handle {
        position: relative;
        width: 48px;
        height: 5px;
        background: rgba(255, 255, 255, 0.4);
        margin: 0.75rem auto;
        cursor: grab;
    }

    .sheet-handle:active {
        cursor: grabbing;
    }

    .sheet-handle::before,
    .sheet-handle::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        background: inherit;
        border-radius: inherit;
    }

    .sheet-handle::before {
        top: -8px;
    }

    .sheet-handle::after {
        top: 8px;
    }
}

/* Mobile-specific gallery item aspect ratio */
@media (max-width: 480px) {
    .gallery-grid .gallery-item {
        aspect-ratio: 1;
    }

    .gallery-grid .gallery-item img {
        height: 100%;
        width: 100%;
        object-fit: cover;
    }
}

/* Improve readability on small screens */
@media (max-width: 360px) {
    .project-title {
        font-size: 1.375rem;
    }

    .content-section h2 {
        font-size: 1.0625rem;
    }

    .content-section p,
    .services-list li,
    .tech-specs > div {
        font-size: 0.875rem;
    }

    .gallery-header h2,
    .related-projects h2 {
        font-size: 1.125rem;
    }

    .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.9375rem;
    }
}