/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #fefefe;
    overflow-x: hidden;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    right: 0;
    padding: 2rem;
    z-index: 1000;
}

.nav-toggle {
    font-size: 0.875rem;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.nav-toggle:hover {
    opacity: 1;
}

/* Hero Section */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8rem 2rem 6rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.hero-description {
    max-width: 700px;
    font-size: 1.125rem;
    line-height: 1.8;
    color: #4a4a4a;
}

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

/* Project Sections */
.project-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    border-top: 1px solid #e0e0e0;
    min-height: 100vh;
}

.project-section:last-of-type {
    padding-bottom: 20vh;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 400;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.section-description {
    font-size: 1rem;
    color: #666;
    max-width: 600px;
    display: block;
}

/* Gallery */
.gallery {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}


.gallery::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.gallery-item {
    flex: 0 0 calc(100% - 2rem);
    aspect-ratio: 4/3;
    border-radius: 6px;
    transition: transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    scroll-snap-align: start;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.gallery-item:hover {
    transform: translateY(-2px);
    opacity: 0.96;
}

/* Project Cards */
.project-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.project-card video,
.project-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-card img.dark-filter {
    filter: brightness(0.7);
}

.project-card video,
.project-card img {
    filter: brightness(0.65);
}

.project-card.dark-card {
    position: relative;
}

.project-card.dark-card::before {
    z-index: 3 !important;
}

.project-card.dark-card::after {
    z-index: 2 !important;
}

.project-card.dark-card:hover::after {
    background: rgba(0, 0, 0, 0.9) !important;
}

.project-card.dark-card video,
.project-card.dark-card img {
    z-index: 0;
    filter: none;
}

.project-card.dark-card:not(:hover)::after {
    content: '' !important;
    background: rgba(0, 0, 0, 0.35) !important;
    opacity: 1 !important;
}

.project-card video.cover-fit,
.project-card img.cover-fit {
    object-fit: cover;
}

.project-card img.vertical-fit {
    object-fit: cover;
    object-position: center;
}

.project-card::before {
    content: attr(data-title);
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    color: white;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 2;
}

.card-number {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
}

.project-card::after {
    content: attr(data-description);
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    overflow-y: auto;
    overflow-x: hidden;
}

.project-card:hover::after,
.project-card.show-description::after,
.project-card:focus::after {
    opacity: 1;
}

/* Project Description with HTML/Links */
.project-description {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-description {
    opacity: 1;
}

.project-description a {
    color: #FFD500;
    text-decoration: underline;
}

.project-description a:hover {
    color: #FFF;
}

@media (min-width: 768px) {
    .gallery-item {
        flex: 0 0 calc(50% - 0.5rem);
    }
}

@media (min-width: 1024px) {
    .gallery-item {
        flex: 0 0 calc(33.333% - 0.667rem);
    }
}

/* Gallery Navigation */
.gallery-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

button:focus-visible,
.gallery-item:focus-visible,
.project-card:focus-visible {
    outline: 2px solid #0F62FE;
    outline-offset: 2px;
}

.nav-arrow {
    background: transparent;
    border: 1px solid #d0d0d0;
    color: #666;
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-arrow:hover {
    border-color: #0F62FE;
    color: #0F62FE;
    background: rgba(15, 98, 254, 0.05);
}

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

.nav-arrow:disabled:hover {
    border-color: #d0d0d0;
    color: #666;
    background: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding: 6rem 1.5rem 4rem;
    }
    
    .hero-title {
        margin-bottom: 2rem;
    }
    
    .project-section {
        padding: 3rem 1.5rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav {
        padding: 1.5rem;
    }
    
    .hero {
        padding: 5rem 1rem 3rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .project-section {
        padding: 2rem 1rem;
    }
}

/* Image Loading States */
.gallery-item[style*="background-image"] {
    background-color: #f5f5f5;
}
/* About Section */
.about-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem 8rem;
    border-top: 1px solid #e0e0e0;
}

.about-content {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.about-photo-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 320px;
}

.about-cutout {
    position: relative;
    transform: translateX(70px);
}

.about-photo {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    border: none;
    box-shadow: none;
    transform-origin: 50% 100%;
    animation: wiggle 6s ease-in-out infinite;
}

.about-photo.wiggle-fast {
    animation-name: wiggleAggro;
    animation-duration: 1.2s;
}

/* Tomato splat overlay */
.tomato-splat {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    background:
        radial-gradient(circle at 52% 48%, rgba(15, 98, 254, 0.98) 0%, rgba(15, 98, 254, 0.9) 16%, rgba(15, 98, 254, 0.0) 58%),
        radial-gradient(circle at 52% 48%, rgba(255, 51, 102, 0.78) 0%, rgba(255, 51, 102, 0.0) 62%),
        radial-gradient(circle at 52% 48%, rgba(255, 213, 0, 0.70) 0%, rgba(255, 213, 0, 0.0) 66%),
        radial-gradient(circle at 52% 48%, rgba(0, 200, 120, 0.62) 0%, rgba(0, 200, 120, 0.0) 70%),
        radial-gradient(circle at 52% 48%, rgba(160, 90, 255, 0.58) 0%, rgba(160, 90, 255, 0.0) 74%);
    transform: scale(0.65);
    filter: blur(0.2px);
}

.tomato-splat::after {
    content: 'OUR POWERS COMBINE!';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: clamp(1.2rem, 3.2vw, 2.2rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 10px 28px rgba(0,0,0,0.35);
    opacity: 0;
    text-align: center;
    width: min(92vw, 900px);
}

.tomato-splat.show::after {
    animation: splatText 950ms ease-out forwards;
}

@keyframes splatText {
    0% { opacity: 0; transform: translate(-50%, -50%) translateY(-6px) scale(0.98); }
    20% { opacity: 1; transform: translate(-50%, -50%) translateY(0) scale(1); }
    60% { opacity: 1; transform: translate(-50%, -50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) translateY(2px) scale(1.02); }
}

.tomato-splat.show {
    animation: tomatoSplat 950ms ease-out forwards;
}

@keyframes tomatoSplat {
    0% { opacity: 0; transform: scale(0.45); }
    18% { opacity: 1; transform: scale(1.05); }
    55% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .tomato-splat.show {
        animation: none;
    }
    .tomato-splat.show::after {
        animation: none;
        opacity: 1;
    }
}

.speech-bubble {
    position: absolute;
    top: 18px;
    right: 100px;
    background: #fff;
    color: #111;
    border: 1px solid #e0e0e0;
    padding: 0.35rem 0.7rem;
    font-size: 0.9rem;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    font-weight: 500;
    z-index: 2;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    left: 14px;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    transform: rotate(45deg);
}

.intro-bubble {
    position: relative;
    flex: 1 1 auto;
    max-width: 800px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 1.75rem 1.75rem;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    max-height: 440px;
    overflow: auto;
    color: #4a4a4a;
}

.intro-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 48px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    transform: rotate(45deg);
}

.intro-bubble::-webkit-scrollbar {
    width: 10px;
}

.intro-bubble::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
}

.intro-bubble::-webkit-scrollbar-track {
    background: transparent;
}

.about-lede {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    margin: 0 0 1rem 0;
    color: #111;
    font-weight: 500;
}

.intro-bubble p {
    margin-bottom: 1.25rem;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-1.5deg); }
    40% { transform: rotate(1.5deg); }
    60% { transform: rotate(-1deg); }
    80% { transform: rotate(1deg); }
}

@keyframes wiggleAggro {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    12% { transform: rotate(-4deg) translateY(-1px); }
    24% { transform: rotate(4deg) translateY(-1px); }
    36% { transform: rotate(-3deg) translateY(0); }
    48% { transform: rotate(3deg) translateY(0); }
    60% { transform: rotate(-2deg) translateY(0); }
    72% { transform: rotate(2deg) translateY(0); }
    84% { transform: rotate(-1deg) translateY(0); }
}

@media (max-width: 768px) {
    .about-section {
        padding: 4rem 1.5rem 6rem;
    }

    .about-content {
        flex-direction: column;
        gap: 1rem;
    }

    .about-photo-wrap {
        width: 260px;
    }

    .about-cutout {
        transform: translateX(40px);
    }

    .speech-bubble {
        font-size: 0.8rem;
        top: 14px;
        right: 92px;
    }

    .intro-bubble {
        max-height: none;
        padding: 1.25rem 1.25rem;
    }

    .intro-bubble::before {
        display: none;
    }
}

/* Print Styles */
@media print {
    .nav,
    .gallery-nav {
        display: none;
    }
    
    .project-section,
    .about-section {
        page-break-inside: avoid;
    }
}
