/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #000;
    --secondary-color: #241a1a;
    --background-color: #ffffff;
    --light-gray: #f5f5f5;
    --border-color: #e5e5e5;
    --accent-color: #0066ff;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--primary-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.loading-content .logo {
    margin-bottom: 32px;
}

.loading-content .logo h1 {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 32px;
    letter-spacing: -0.05em;
    opacity: 0;
    animation: fadeInLogo 0.8s ease-out 0.2s forwards;
    font-display: swap; /* Helps with font loading */
}

.loading-content .logo-heavy {
    font-weight: 700;
    color: var(--primary-color);
}

.loading-content .logo-light {
    font-weight: 300;
    color: var(--secondary-color);
}

@keyframes fadeInLogo {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.05em;
    margin-bottom: 32px;
}

.loading-logo-heavy {
    font-weight: 700;
    color: var(--primary-color);
}

.loading-logo-light {
    font-weight: 300;
    color: var(--secondary-color);
}

.loading-spinner {
    margin: 32px 0;
    display: flex;
    justify-content: center;
    opacity: 0;
    animation: fadeInSpinner 0.6s ease-out forwards;
}

@keyframes fadeInSpinner {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--secondary-color);
    font-size: 16px;
    font-weight: 400;
    margin-top: 16px;
    opacity: 0;
    animation: fadeInText 0.6s ease-out 0.4s forwards;
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
.main-content {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.main-content.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.logo h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 24px;
    letter-spacing: -0.05em;
    color: var(--primary-color);
}

.logo-heavy {
    font-weight: 700;
}

.logo-light {
    font-weight: 300;
}

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: var(--transition);
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 400;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 0 24px; /* Remove top/bottom padding, keep horizontal */
    text-align: center;
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.hero .hero-title {
    font-size: clamp(48px, 8vw, 80px);
    font-weight: 300;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
    line-height: 0.9;
    color: var(--primary-color);
}

.hero .hero-subtitle {
    font-size: 20px;
    color: var(--secondary-color);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Work Section */
.work {
    padding: 80px 0 0 0; /* Remove bottom padding, keep top */
}

.section-title {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 48px;
    text-align: center;
    letter-spacing: -0.02em;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0; /* Remove gaps for full-width effect */
    margin-bottom: 0;
    width: 100vw; /* Full viewport width */
    margin-left: calc(-50vw + 50%); /* Center and extend to edges */
}

.project-card {
    cursor: pointer;
    transition: var(--transition);
    border-radius: 0; /* Remove rounded corners */
    overflow: hidden;
    background: var(--background-color);
    position: relative;
    height: 60vh; /* Taller cards for more impact */
    width: 100%;
    /* Keyboard accessibility */
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.project-card:hover,
.project-card:focus {
    transform: translateY(0);
    outline: 3px solid var(--primary-color);
    outline-offset: -3px;
}

.project-card:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: -3px;
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.1);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
    display: block;
}

.project-card:hover .project-image,
.project-card:focus .project-image {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    color: white;
    opacity: 0;
    transition: opacity 0.4s ease;
    text-align: center;
}

.project-card:hover .project-overlay,
.project-card:focus .project-overlay {
    opacity: 1;
}

.project-info h3 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.project-info p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 600px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.project-tags .tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 400;
}

/* General tag styles for other sections */
.tag {
    background-color: var(--light-gray);
    color: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 400;
}



/* About Section */
.about {
    padding: 0 24px; /* Remove top/bottom padding, keep horizontal */
    background-color: var(--light-gray);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    width: 100%;
}

.about-content p {
    font-size: 18px;
    color: var(--secondary-color);
    line-height: 1.7;
    margin-bottom: 24px;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* Contact Section */
.contact {
    padding: 80px 0;
    text-align: center;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 16px 32px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
}

.contact-link:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 80px 0 0;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 60px;
    align-items: start;
    margin-bottom: 60px;
}

.footer-left {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.footer-logo h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.05em;
    margin-bottom: 16px;
}

.footer-logo .logo-heavy {
    font-weight: 700;
    color: white;
}

.footer-logo .logo-light {
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
}

.footer-tagline {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    max-width: 200px;
}

.footer-center {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.footer-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
    letter-spacing: -0.01em;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li:last-child {
    margin-bottom: 0;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.footer-section ul li a:hover {
    color: white;
    transform: translateX(4px);
}

.footer-section ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: white;
    transition: width 0.3s ease;
}

.footer-section ul li a:hover::after {
    width: 100%;
}

.footer-email {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 2px;
}

.footer-right {
    text-align: right;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.6s forwards;
}

.footer-cta h4 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    color: white;
    line-height: 1.3;
}

.footer-cta-button {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.footer-cta-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

.footer-bottom-left p,
.footer-bottom-right p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0;
}

.footer-bottom-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-pulse {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(0, 255, 136, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
    }
}

/* Footer responsive design */
@media (max-width: 768px) {
    .footer {
        padding: 60px 0 0;
        margin-top: 60px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        margin-bottom: 40px;
    }
    
    .footer-left,
    .footer-right {
        text-align: center;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-tagline {
        max-width: none;
        margin: 0 auto;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .footer-bottom-right {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .footer-container {
        padding: 0 16px;
    }
    
    .footer-content {
        gap: 32px;
    }
    
    .footer-logo h3 {
        font-size: 24px;
    }
    
    .footer-cta h4 {
        font-size: 16px;
    }
}

/* Enhanced Case Study Modal Styles */
.case-study-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--background-color);
    z-index: 9999;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.case-study-modal.active {
    opacity: 1;
}

.case-study-container {
    width: 100%;
    min-height: 100vh;
}

/* Navigation Header */
.case-study-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.case-study-nav.hidden {
    transform: translateY(-100%);
}

.nav-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-close:hover {
    background: var(--light-gray);
    transform: rotate(90deg);
}

.nav-progress {
    flex: 1;
    max-width: 200px;
    height: 2px;
    background: var(--light-gray);
    margin: 0 2rem;
    border-radius: 1px;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 1px;
    transition: width 0.3s ease;
    width: 0%;
}

.nav-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-counter {
    font-size: 14px;
    color: var(--secondary-color);
    font-weight: 500;
}

.nav-arrows {
    display: flex;
    gap: 8px;
}

.nav-prev, .nav-next {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color);
    font-size: 16px;
}

.nav-prev:hover, .nav-next:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-prev:disabled, .nav-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-prev:disabled:hover, .nav-next:disabled:hover {
    background: none;
    color: var(--primary-color);
    border-color: var(--border-color);
}

/* Hero Section */
.case-study-hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

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

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 8s ease-out;
}

.case-study-modal.active .hero-image {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    color: white;
    text-align: center;
}

.hero-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.5s forwards;
}

.project-category, .project-year {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

.case-study-hero .hero-title {
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 300;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 0.9;
    color: white;
    opacity: 0;
    animation: fadeInUp 1s ease 0.7s forwards;
}

.case-study-hero .hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    opacity: 0;
    animation: fadeInUp 1s ease 0.9s forwards;
}

.hero-tags {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 1s ease 1.1s forwards;
}

.hero-tags .tag {
    background: rgba(0, 0, 0, 0.9);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    text-align: center;
    color: white;
    z-index: 3;
    opacity: 0;
    animation: fadeInUp 1s ease 1.3s forwards;
    width: 100%;
    display: inline-block;
}

.scroll-indicator span {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 auto;
    margin-bottom: 1rem;
    
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: white;
    margin: 0 auto;
    animation: scrollPulse 2s ease-in-out infinite;
}

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

/* Content Sections */
.case-study-content .case-study-overview,
.case-study-content .case-study-gallery,
.case-study-content .case-study-results,
.case-study-content .case-study-next {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.case-study-content .case-study-next {
    padding: 0rem 2rem;
    margin: 3rem auto;
    border-top: 2px solid var(--border-color);
    box-sizing:content-box;
}

.case-study-overview {
    /* background: var(--light-gray); */
}

.overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.overview-details h2 {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.project-description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--secondary-color);
    margin-bottom: 3rem;
}

.overview-challenge h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.challenge-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--secondary-color);
}

.overview-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.overview-shopify h3,
.overview-client h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.overview-shopify {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

/* Shopify button container - minimal styling to let Shopify handle appearance */
.shopify-button-container {
    margin-top: 0.5rem;
}

.overview-client h3,
.overview-challenge h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.client-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--secondary-color);
}

/* Enhanced text formatting for case study content */
.project-description p,
.challenge-text p,
.client-text p {
    margin-bottom: 1.5rem;
}

.project-description p:last-child,
.challenge-text p:last-child,
.client-text p:last-child {
    margin-bottom: 0;
}

/* General case study content text improvements */
.case-study-content h2 {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.case-study-content h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    margin-top: 2.5rem;
    color: var(--primary-color);
    letter-spacing: -0.01em;
}

.case-study-content h3:first-child {
    margin-top: 0;
}

.case-study-content p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.case-study-content p:last-child {
    margin-bottom: 0;
}

/* List formatting for case study content */
.project-description ul,
.project-description ol,
.challenge-text ul,
.challenge-text ol,
.client-text ul,
.client-text ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.project-description li,
.challenge-text li,
.client-text li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.project-description li:last-child,
.challenge-text li:last-child,
.client-text li:last-child {
    margin-bottom: 0;
}

/* Nested lists */
.project-description ul ul,
.project-description ol ol,
.project-description ul ol,
.project-description ol ul,
.challenge-text ul ul,
.challenge-text ol ol,
.challenge-text ul ol,
.challenge-text ol ul,
.client-text ul ul,
.client-text ol ol,
.client-text ul ol,
.client-text ol ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* Strong and emphasis formatting */
.project-description strong,
.challenge-text strong,
.client-text strong {
    font-weight: 600;
    color: var(--primary-color);
}

.project-description em,
.challenge-text em,
.client-text em {
    font-style: italic;
    color: var(--secondary-color);
}

/* Process Timeline */
/* Gallery */
.case-study-gallery {
    /* background: var(--light-gray); */
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
    outline: none;
}

.gallery-item:hover,
.gallery-item:focus {
    transform: translateY(-8px);
}

.gallery-item:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.gallery-item:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
    display: block;
    min-height: 100%;
}

.gallery-item:hover img,
.gallery-item:focus img {
    transform: scale(1.05);
}

/* Results Section */
.case-study-results {
    background: var(--primary-color);
    color: white;
}

.case-study-results h2 {
    color: white;
    text-align: center;
    margin-bottom: 3rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.result-metric {
    text-align: center;
}

.metric-number {
    display: block;
    font-size: 4rem;
    font-weight: 300;
    color: white;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

.results-summary {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.results-summary p {
    font-size: 1.25rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.results-summary p:last-child {
    margin-bottom: 0;
}

/* Next Project */
.case-study-next {
    /* background: white; */
}
.case-study-next h3 {
    /* text-transform: uppercase;
    font-weight: 100;
    font-size: .75rem; */
}

.next-project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-top: 2rem;
}

.next-project-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    display: block;
    min-height: 100%;
}

.next-project-title {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.next-project-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.next-project-description p {
    margin-bottom: 1.5rem;
}

.next-project-description p:last-child {
    margin-bottom: 0;
}

.next-project-description ul,
.next-project-description ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.next-project-description li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.next-project-description li:last-child {
    margin-bottom: 0;
}

.next-project-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.next-project-btn:hover {
    background: var(--secondary-color);
    transform: translateX(4px);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 60px 20px; /* Add padding to prevent clipping */
    box-sizing: border-box;
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 20px;
    padding: 16px 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.3s ease;
    z-index: 1;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .case-study-nav {
        padding: 0 1rem;
    }
    
    .hero-content {
        padding: 0 1rem;
    }
    
    .case-study-content section {
        padding: 4rem 1rem;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .overview-shopify {
        order: -1; /* Move Shopify button to top on mobile */
    }
    
    .timeline-item,
    .timeline-item:nth-child(even) {
        flex-direction: column;
        text-align: center;
    }
    
    .timeline-content {
        margin: 2rem 0;
        max-width: 100%;
    }
    
    .timeline-item:nth-child(even) .timeline-content {
        text-align: center;
    }
    
    .process-timeline::before {
        display: none;
    }
    
    .timeline-marker {
        position: relative;
        left: auto;
        transform: none;
        margin: 0 auto 1rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .next-project-card {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-progress {
        max-width: 100px;
        margin: 0 1rem;
    }
    
    .lightbox-prev, .lightbox-next {
        position: fixed;
        top: 50%;
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
}


@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -300px;
        height: 100vh;
        width: 250px;
        background-color: var(--background-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 18px;
        font-weight: 500;
    }

    .hero {
        padding: 120px 24px 60px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .modal-content {
        margin: 10% auto;
        padding: 24px;
        width: 95%;
    }

    .project-detail-image {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .nav {
        padding: 16px;
    }

    .hero {
        padding: 100px 16px 40px;
    }

    .work, .about, .contact {
        padding: 60px 0 0 0; /* Remove bottom padding for work section */
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 0; /* Keep full-width effect on mobile */
        margin-left: calc(-50vw + 50%); /* Maintain edge-to-edge on mobile */
    }

    .project-card {
        height: 50vh; /* Responsive height for mobile */
        border-radius: 0; /* Ensure no rounded corners on mobile */
    }

    /* Maintain focus visibility on mobile */
    .project-card:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: -2px;
    }

    .project-overlay {
        padding: 2rem;
        opacity: 1; /* Always show overlay on mobile */
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .project-info h3 {
        font-size: 1.5rem;
    }

    .project-info p {
        font-size: 0.9rem;
    }
}

/* Conditional Section Display Rules */
.case-study-overview,
.case-study-results,
.overview-challenge,
.overview-client {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.case-study-overview[style*="display: none"],
.case-study-results[style*="display: none"],
.overview-challenge[style*="display: none"],
.overview-client[style*="display: none"] {
    opacity: 0;
    transform: translateY(-10px);
}

/* Ensure sections are visible when shown */
.case-study-overview:not([style*="display: none"]),
.case-study-results:not([style*="display: none"]),
.overview-challenge:not([style*="display: none"]),
.overview-client:not([style*="display: none"]) {
    opacity: 1;
    transform: translateY(0);
}
