/* Case study / project detail pages */
:root {
    --project-bg: #f2f2f2;
    --project-text: #333333;
    --project-surface: #ffffff;
    --project-accent-blue: #0056b3;
    --project-accent-gold: #d4af37;
    --project-radius: 12px;
    --project-max: 1200px;
    --project-gutter: clamp(1.25rem, 4vw, 3rem);
}

html {
    scroll-behavior: smooth;
}

.project-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--project-bg);
    color: var(--project-text);
    line-height: 1.6;
    min-height: 100vh;
}

.project-page nav a.logo {
    text-decoration: none;
    color: #000;
}

.project-intro {
    max-width: var(--project-max);
    margin: 0 auto;
    padding: 2.5rem var(--project-gutter) 3rem;
    text-align: center;
}

.project-intro h1 {
    font-size: clamp(1.35rem, 3.5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.25;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
}

.project-intro p {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 1rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 42em;
}

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

/* Sections */
.project-section {
    max-width: var(--project-max);
    margin: 0 auto;
    padding: 0 var(--project-gutter) 3.5rem;
}

.project-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.65rem;
    color: #222;
}

.project-section-lead {
    font-size: 0.95rem;
    color: #555;
    max-width: 48em;
    margin-bottom: 1.75rem;
}

/* White panels */
.project-panel {
    background: var(--project-surface);
    border-radius: var(--project-radius);
    padding: clamp(1.5rem, 4vw, 2.75rem);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.project-panel > .project-section-title {
    margin-bottom: 1.25rem;
}

.project-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 768px) {
    .project-split {
        grid-template-columns: 1fr;
    }
}

.project-split h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.project-split p {
    font-size: 0.95rem;
    color: #555;
}

/* Figures — images always scale to container, never overflow */
.project-figure {
    margin: 0;
}

.project-figure img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: var(--project-radius);
    /* Prevent blurry upscaling */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.project-figure--slide {
    margin-top: 0.25rem;
}

/* GIF figures: suppress any inherited transform or animation that can pause decoding */
.project-figure--gif img,
.project-motion-gif {
    transform: none !important;
    animation: none !important;
    /* Override crisp-edges for GIFs — auto gives better quality for photos/animations */
    image-rendering: auto;
}

.project-figure--phones-row img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: var(--project-radius);
}

/* Placeholders */
.media-placeholder {
    background: linear-gradient(145deg, #e8e8e8 0%, #dedede 50%, #e5e5e5 100%);
    border-radius: var(--project-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
    border: 1px dashed rgba(0, 0, 0, 0.12);
}

.media-placeholder--phone {
    aspect-ratio: 9 / 19;
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
}

.media-placeholder--video {
    aspect-ratio: 16 / 9;
    width: 100%;
}

.wireframe-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.wireframe-row .media-placeholder {
    flex: 0 0 auto;
    width: min(140px, 28vw);
    aspect-ratio: 9 / 16;
    scroll-snap-align: start;
    font-size: 0.65rem;
}

.social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.social-grid .media-placeholder {
    aspect-ratio: 4 / 5;
    min-height: 180px;
}

.social-grid-span {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
}

.social-grid-span .media-placeholder {
    width: min(100%, 440px);
    aspect-ratio: 16 / 10;
}

@media (max-width: 600px) {
    .social-grid {
        grid-template-columns: 1fr;
    }

    .social-grid-span {
        grid-column: 1;
    }
}

/* Responsive 16:9 video embed */
.video-embed-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--project-radius);
    overflow: hidden;
    background: #000;
}

.video-embed-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.project-footer {
    text-align: center;
    padding: 2.5rem var(--project-gutter) 2rem;
}

.project-footer a {
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: #555;
}

.project-footer a:hover {
    color: var(--project-accent-blue);
}

.project-copyright {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #777;
}
