/* Desktop Work Collage Balance */
@media (min-width: 1201px) {
    .homepage-work-card-cen,
    .homepage-work-card-camerata {
        width: 92%;
    }

    .homepage-work-card-cen {
        top: 10%;
    }

    .homepage-work-card-camerata {
        bottom: 10%;
    }

    .homepage-work-card-wedding {
        top: 25%;
        width: 48%;
    }
}

/* Large Desktop and Tablet Landscape */
@media (max-width: 1200px) {
    /* Design Gallery Responsive Column Counts */
    .design-gallery {
        column-count: 3;
    }

    .categories-container.wedding-principles {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .homepage-mission-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .homepage-work-art {
        width: min(100%, 760px);
        min-height: 620px;
        margin: 0 auto;
    }
    
    /* UI Options Responsive Breakpoints */
    .ui-options-grid {
        padding: 0 1.5rem;
        gap: 3rem;
    }
    
    .ui-option {
        gap: 2rem;
    }
    
    .ui-option-content h3 {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }
    
    .ui-option-content p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .brand-project,
    .brand-project:nth-child(even),
    .freelance-project,
    .freelance-project:nth-child(even),
    .music-release,
    .music-release:nth-child(even),
    .ux-process-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
    .nav-container {
        grid-template-columns: auto 1fr auto;
        padding: 0.5rem 1rem;
    }

    .nav-left {
        display: none;
    }

    .nav-right,
    .nav-social {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        justify-self: end;
    }

    .mobile-menu {
        display: block;
        background-color: var(--secondary-color);
    }

    .mobile-nav-section {
        margin-bottom: 1.5rem;
    }

    .mobile-nav-item {
        display: block;
        position: relative;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--white);
        font-size: 1.25rem;
        text-decoration: none;
    }

    .mobile-nav-item.has-submenu::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 0.25rem;
        width: 0.5rem;
        height: 0.5rem;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-65%) rotate(45deg);
        transition: transform var(--transition-default);
    }

    .mobile-nav-item.has-submenu.active::after {
        transform: translateY(-20%) rotate(225deg);
    }

    .mobile-subnav {
        display: none;
        max-height: 0;
        margin: 0.5rem 0;
        padding-left: 1rem;
        overflow: hidden;
        transition: max-height var(--transition-default);
    }

    .mobile-subnav.active {
        display: block;
        max-height: 500px;
    }

    .mobile-subnav a {
        display: block;
        padding: 0.65rem 0;
        color: rgba(255, 255, 255, 0.8);
        font-size: 1rem;
        text-decoration: none;
    }

    .mobile-social {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        padding: 1.5rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 1.5rem;
    }

    .mobile-social a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        color: var(--white);
        font-size: 1.35rem;
    }

    .burger-line {
        background-color: var(--white);
    }

    .nav-center {
        justify-self: center;
    }

    .footer-nav {
        flex-wrap: wrap;
    }

    .section {
        padding: 3rem 1.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .mission-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .homepage-work-art {
        width: min(100%, 640px);
        min-height: 520px;
        margin: 0 auto;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .deep-dive-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .deep-dive-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .specialties-columns,
    .passions-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .motivated-section h2 {
        font-size: 2.7rem;
    }
    
    .motivated-section p {
        font-size: 1.5rem;
    }
    
    /* Make wave background images black and white on mobile */
    .motivated-section[style*="footer-waves"],
    .hero-with-bg[style*="footer-waves"] {
        filter: grayscale(100%);
    }
    
    /* Ensure the filter doesn't affect the content */
    .motivated-section[style*="footer-waves"] .motivated-content,
    .hero-with-bg[style*="footer-waves"] .hero-content {
        filter: none;
    }
    
    /* UI Options Responsive Breakpoints */
    .ui-option {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .ui-option:nth-child(even) {
        grid-template-columns: 1fr;
    }
    
    .ui-option:nth-child(even) .ui-option-image {
        order: 1;
    }
    
    .ui-option:nth-child(even) .ui-option-content {
        order: 2;
    }
    
    .ui-option-image {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .ui-option-content h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .ui-option-content p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

/* Tablet Portrait */
@media (max-width: 900px) {
    .design-gallery {
        column-count: 2;
    }

    .brand-project,
    .brand-project:nth-child(even),
    .freelance-project,
    .freelance-project:nth-child(even),
    .music-release,
    .music-release:nth-child(even),
    .ux-process-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .brand-project:nth-child(even) .brand-project-image,
    .freelance-project:nth-child(even) .freelance-image,
    .music-release:nth-child(even) .release-artwork {
        order: 1;
    }

    .brand-project:nth-child(even) .brand-project-content,
    .freelance-project:nth-child(even) .freelance-content,
    .music-release:nth-child(even) .release-content {
        order: 2;
    }

    .wedding-hero {
        min-height: auto;
        padding-top: 5rem;
        padding-bottom: 5rem;
    }

    .wedding-hero-inner,
    .wedding-feature,
    .wedding-feature-reverse,
    .wedding-details-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .wedding-hero-inner {
        gap: 2.5rem;
    }

    .wedding-hero-copy {
        text-align: center;
    }

    .wedding-hero .hero-title,
    .wedding-hero .hero-subtitle {
        margin-right: auto;
        margin-left: auto;
    }

    .wedding-hero-art {
        width: min(100%, 520px);
        min-height: 0;
        margin: 0 auto;
    }

    .wedding-feature,
    .wedding-details-layout {
        gap: 2.5rem;
    }

    .wedding-feature-reverse .wedding-feature-copy {
        order: 1;
    }

    .wedding-feature-reverse .wedding-hospitality-media {
        order: 2;
    }

    .wedding-signage-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .categories-container.wedding-principles {
        grid-template-columns: minmax(0, 1fr);
    }

    .wedding-gallery-item-featured {
        grid-column: 1 / -1;
        width: min(100%, 480px);
        margin: 0 auto;
    }

    .featured-design-project {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .featured-design-project-image {
        max-height: 560px;
    }

    .featured-design-project-content {
        padding: 2rem;
    }

}

/* Mobile Landscape and Small Tablet */
@media (max-width: 768px) {
    .main-content {
        padding-top: 70px;
    }

    .section[id] {
        scroll-margin-top: 70px;
    }

    .header {
        height: 70px;
    }

    .nav {
        padding: 0.5rem;
    }

    .nav-container {
        gap: 1rem;
        align-items: center;
    }

    .nav-logo-img {
        height: 40px;
    }

    .mobile-menu {
        top: 70px; /* Match header height */
        height: calc(100vh - 70px);
        height: calc(100svh - 70px);
        background-color: var(--secondary-color);
    }

    .hero,
    .hero-fullscreen {
        min-height: calc(100vh - 70px);
        min-height: calc(100svh - 70px);
        background-attachment: scroll;
    }

    .mobile-nav-section {
        margin-bottom: 1.5rem;
    }

    .mobile-nav-item {
        display: block;
        font-size: 1.25rem;
        color: var(--white);
        text-decoration: none;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: relative;
    }

    .mobile-nav-item:hover {
        color: var(--light-accent-color);
    }

    .mobile-subnav {
        display: none;
        padding-left: 1rem;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        overflow: hidden;
        max-height: 0;
        transition: max-height var(--transition-default);
    }

    .mobile-subnav.active {
        display: block;
        max-height: 500px; /* Large enough to contain all content */
    }

    .mobile-subnav a {
        display: block;
        padding: 0.5rem 0;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        font-size: 1rem;
        transition: color var(--transition-fast), padding var(--transition-fast);
    }

    .mobile-subnav a:hover {
        color: var(--white);
        padding-left: 0.5rem;
    }

    .mobile-social {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        padding: 1.5rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 1.5rem;
    }

    .mobile-social a {
        color: var(--white);
        font-size: 1.5rem;
        transition: color var(--transition-fast), transform var(--transition-fast);
    }

    .mobile-social a:hover {
        color: var(--light-accent-color);
        transform: translateY(-2px);
    }

    .footer {
        padding: 3rem 1.5rem 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-nav {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-legal {
        flex-direction: column;
        gap: 1rem;
    }

    .social-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .section {
        padding: 3rem 1.5rem;
    }

    .hero {
        min-height: calc(100vh - 70px);
        padding: 3rem 1.5rem;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .hero-cta {
        margin-top: 2rem;
    }

    .project-image,
    .endeavor-image {
        padding: 0.75rem 0.75rem 0 0.75rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-card,
    .endeavor-card {
        max-width: 100%;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .endeavors-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Design gallery mobile adjustments */
    .design-gallery {
        column-count: 2;
        column-gap: 1.5rem;
        padding: 0 1rem;
    }

    .motivated-section {
        padding: 4rem 1.5rem;
        background-attachment: scroll;
    }

    .motivated-section h2 {
        font-size: 2.2rem;
    }

    .motivated-section p {
        font-size: 1.4rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .mission-content,
    .project-description,
    .endeavor-description {
        font-size: 1rem;
    }

    .project-content,
    .endeavor-content {
        padding: 1.25rem;
    }

    .project-brief {
        padding: 1.4rem 0 1.5rem;
    }

    .project-brief-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .project-brief .project-brief-link {
        width: 100%;
    }

    .project-brief-meta {
        margin-top: 1rem;
    }

    .brand-project,
    .freelance-project,
    .music-release {
        padding: 1.5rem;
    }
    
    /* Design gallery small mobile adjustments */
    .design-gallery {
        column-gap: 1rem;
        padding: 0 0.5rem;
    }

    .wedding-introduction {
        margin-top: 2rem;
    }

    .wedding-stationery-grid {
        gap: 0.75rem;
    }

    .wedding-stationery-grid a,
    .wedding-detail-gallery a {
        border-width: 4px;
    }

    .wedding-gallery {
        gap: 1rem;
        margin-top: 2rem;
    }

    .wedding-gallery-item figcaption {
        padding: 0.85rem 0.9rem 1rem;
        font-size: 0.9rem;
    }

    .wedding-detail-gallery {
        gap: 0.75rem;
    }
    
    /* Mobile optimizations for Magnific Popup */
    .magnific-popup-image:hover {
        transform: none; /* Disable transform on mobile for better performance */
    }
    
    /* UI Options Responsive Breakpoints */
    .ui-options-grid {
        padding: 0 1rem;
        gap: 2rem;
    }
    
    .ui-option {
        gap: 1rem;
    }
    
    .ui-option-content h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    .ui-option-content p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Rapid Prototyping Responsive Adjustments */
    .rp-report-pages {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 1rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .homepage-work-art {
        min-height: 400px;
        padding: 1rem 0;
    }

    .homepage-work-card {
        border-width: 4px;
    }

    .homepage-work-card-cen,
    .homepage-work-card-camerata {
        width: 84%;
    }

    .homepage-work-card-wedding {
        width: 42%;
    }

    .wedding-hero {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

    .wedding-hero-inner {
        gap: 1.5rem;
    }

    .wedding-hero-art {
        padding: 1rem 0;
    }

    .wedding-hero-card {
        border-width: 4px;
    }

    .wedding-hero-card-front {
        margin-left: -1rem;
    }

    .wedding-stationery-grid a:nth-child(2) {
        transform: translateY(0.75rem);
    }

    .wedding-signage-gallery {
        grid-template-columns: minmax(0, 1fr);
    }

    .wedding-gallery-item-featured {
        grid-column: auto;
        width: 100%;
    }

    .wedding-hospitality-media {
        padding: 0.75rem;
    }

    .wedding-menu-board {
        max-width: 72%;
        margin-top: 1rem;
    }

    .wedding-detail-gallery {
        grid-template-columns: minmax(0, 1fr);
    }

    .wedding-detail-gallery a {
        width: min(100%, 360px);
        margin: 0 auto;
    }

    .section h2 {
        font-size: 1.75rem;
    }

    .project-image,
    .endeavor-image {
        padding: 0.5rem 0.5rem 0 0.5rem;
    }

    .project-content h3,
    .endeavor-card h3 {
        font-size: 1.25rem;
    }

    .project-description,
    .endeavor-description {
        font-size: 0.95rem;
    }

    .project-content,
    .endeavor-content {
        padding: 1rem;
    }

    .project-category {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    .cta-button {
        width: 100%;
        text-align: center;
        margin: 0.5rem 0;
    }

    .hero .cta-button.outline {
        margin-left: 0;
    }

    .hero-cta {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .motivated-section h2 {
        font-size: 2rem;
    }
    
    .motivated-section p {
        font-size: 1.2rem;
    }

    .mobile-menu-toggle {
        padding: 0;
    }

    .specialties-list li,
    .passions-list li {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .specialties-passions h3 {
        font-size: 1.3rem;
        margin-top: 1.5rem;
    }
    
    /* UI Options Responsive Breakpoints */
    .ui-options-grid {
        padding: 0 0.75rem;
        gap: 1.5rem;
    }
    
    .ui-option-content h3 {
        font-size: 1.1rem;
        margin-bottom: 0.7rem;
    }
    
    .ui-option-content p {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    /* Rapid Prototyping Responsive Adjustments */
    .rp-report-pages {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ========================================
   Additional Responsive Fixes
   ======================================== */

/* Intermediate breakpoint for motivated section padding */
@media (max-width: 1024px) {
    .motivated-section {
        padding: 6rem 2rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .categories-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Fix grids that don't collapse on mobile */
@media (max-width: 768px) {
    .brand-project {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .brand-project:nth-child(even) {
        grid-template-columns: 1fr;
    }
    
    .music-release {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .music-release:nth-child(even) {
        grid-template-columns: 1fr;
    }
    
    .ux-process-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Fix RP models grid overflow */
    .rp-models-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* iOS Safari fix for fixed backgrounds */
    .hero-with-bg {
        background-attachment: scroll;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .categories-container {
        grid-template-columns: 1fr;
    }

    .categories-container,
    .key-stats-grid,
    .case-study-actions,
    .cen-work-controls,
    .cen-work-grid,
    .project-content-section,
    .work-filter-groups,
    .work-index-grid,
    .deep-dive-card-grid,
    .deep-dive-nav {
        padding-right: 0;
        padding-left: 0;
    }

    .work-index-grid,
    .deep-dive-card-grid {
        grid-template-columns: 1fr;
    }

    .deep-dive-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .projects-grid.two-column-project-grid {
        grid-template-columns: 1fr;
    }
    
    .category-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .key-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .case-study-actions {
        flex-direction: column;
    }

    .case-study-actions .cta-button {
        width: 100%;
        margin: 0;
        text-align: center;
    }

    .cen-work-grid {
        grid-template-columns: 1fr;
    }

    .cen-work-card {
        padding: 1.35rem;
    }
}

@media (max-width: 480px) {
    .deep-dive-nav {
        grid-template-columns: 1fr;
    }

    .work-filter-group,
    .work-index-card,
    .deep-dive-card {
        padding: 1.25rem;
    }

    .key-stats-grid {
        grid-template-columns: 1fr;
    }

    .cen-work-controls {
        gap: 0.5rem;
    }

    .cen-work-filter {
        min-height: 44px;
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    .error-main-content {
        min-height: calc(100vh - 70px);
        padding: 0.75rem 0.8rem 1rem !important;
    }

    .error-content-card {
        padding: 1.15rem 1rem 1rem;
        border-radius: 14px;
    }

    .error-kicker {
        font-size: 0.72rem;
        margin-bottom: 0.45rem;
    }

    .error-message {
        font-size: 0.92rem;
        margin-top: 0.7rem;
    }

    .error-content-card .hero-cta {
        margin-top: 0.85rem;
    }

    .error-content-card .cta-button {
        min-width: 170px;
    }
}

@media (max-width: 360px) {
    .hero-title {
        font-size: 1.625rem;
    }
}
