:root {
    --primary: #ffffff;
    --secondary: #a3a3a3;
    --bg: #0a0a0a;
    --accent: #ff8c42;
    --card: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.12);
    --radius-lg: var(--radius-lg, 18px);
    --radius-md: var(--radius-md, 14px);
    --radius-sm: var(--radius-sm, 12px);
}

html {
    font-size: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Space Grotesk", sans-serif;
    background: radial-gradient(circle at 15% 20%, rgba(255, 140, 66, 0.12) 0%, transparent 40%), var(--bg);
    color: var(--primary);
    line-height: 1.6;
}

/* Align with main page nav horizontal padding (style.css nav uses 4rem) */
body.page-project .container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-left: var(--page-pad-x, clamp(2rem, 4vw, 4rem));
    padding-right: var(--page-pad-x, clamp(2rem, 4vw, 4rem));
    box-sizing: border-box;
}

body.page-project main.container {
    padding-top: clamp(3rem, 6vh, 5rem);
}

body.page-project main > header.hero {
    min-height: 0;
    background: none;
    background-image: none;
    padding: 4.5rem 0 2rem;
    overflow: visible;
    position: relative;
}

.eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.78rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-family: "Syne", sans-serif;
    font-size: clamp(2rem, 7vw, 4.2rem);
    line-height: 1.05;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.lead {
    color: var(--secondary);
    max-width: none;
    font-size: 1.05rem;
}

/* Liens dans les descriptions de projet */
.lead a {
    color: var(--accent);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.lead a:hover {
    opacity: 0.8;
}

.meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.meta-item {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 16px;
}

.meta-item .stack {
    margin-top: 0.65rem;
    gap: 0.5rem;
}

.meta-item .stack span {
    padding: 0.4rem 0.65rem;
    font-size: 0.82rem;
    border-radius: 8px;
}

.meta-label {
    color: var(--secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

.meta-value {
    font-weight: 700;
    font-size: 1rem;
}

.gallery {
    padding: 1.4rem 0 3rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
        "a b"
        "a c";
}

.shot {
    border: 1px solid var(--border);
    background: linear-gradient(145deg, #181818 0%, #101010 55%, #141227 100%);
    min-height: 240px;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
}

/* Effet glow sur les cartes de projet */
.shot[data-glow] {
    --base: 280;
    --spread: 300;
    --radius: 24;
    --border: 3;
    --backdrop: hsl(0 0% 60% / 0.12);
    --backup-border: var(--backdrop);
    --size: 200;
    --outer: 1;
    --border-size: calc(var(--border, 2) * 1px);
    --spotlight-size: calc(var(--size, 150) * 1px);
    --hue: calc(var(--base) + (var(--xp, 0) * var(--spread, 0)));
    background-image: radial-gradient(
        var(--spotlight-size) var(--spotlight-size) at
        calc(var(--x, 0) * 1px)
        calc(var(--y, 0) * 1px),
        hsl(var(--hue, 210) calc(var(--saturation, 100) * 1%) calc(var(--lightness, 70) * 1%) / var(--bg-spot-opacity, 0.1)), transparent
    );
    background-color: var(--backdrop, transparent);
    background-size: calc(100% + (2 * var(--border-size))) calc(100% + (2 * var(--border-size)));
    background-position: 50% 50%;
    background-attachment: fixed;
    border: var(--border-size) solid var(--backup-border);
    touch-action: none;
}

/* Contenu au-dessus du glow */
.shot img,
.shot video,
.shot span {
    position: relative;
    z-index: 2;
}

.shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

.shot video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    background: #000;
}

/* Video controls and hover effects */
.shot video:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Ensure videos autoplay properly on mobile */
@media (max-width: 768px) {
    .shot video {
        object-position: center;
    }
    
    .gallery-hero .shot video {
        min-height: 360px;
    }
}

.gallery-hero {
    padding: 1.4rem 0 1rem;
}

.gallery-hero .shot {
    min-height: 480px;
    max-width: 1200px;
    margin: 0 auto;
}

/* THE FALL video - 1.40x larger with responsive */
.gallery-hero--video {
    display: flex;
    justify-content: center;
}

.gallery-hero--video .shot--large {
    min-height: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-hero--video .shot--large video {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: unset;
}


/* Style arrondi pour les labels COWS ROBOT (comme les tags HOUDINI) */
.gallery-grid[aria-label*="COWS ROBOT"] .shot span {
    border: 1px solid var(--border);
    background: var(--card);
    padding: 0.45rem 0.75rem;
    font-size: 0.84rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Layout flex pour COWS ROBOT avec marge statique entre les cartes */
.gallery-grid[aria-label*="COWS ROBOT"] {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
}

.gallery-grid[aria-label*="COWS ROBOT"] .shot {
    flex: 0 0 auto;
}

/* Format paysage pour COWS ROBOT SHOT - taille augmentée */
.gallery-grid[aria-label*="COWS ROBOT"] .shot.shot-landscape {
    width: 640px;
    height: 360px;
    min-height: auto;
    aspect-ratio: 16/9;
}

.gallery-grid[aria-label*="COWS ROBOT"] .shot.shot-landscape img {
    width: 640px;
    height: 360px;
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Format portrait pour COWS ROBOT CONCEPT - même hauteur que landscape */
.gallery-grid[aria-label*="COWS ROBOT"] .shot.shot-portrait {
    width: 200px;
    height: 360px;
    min-height: auto;
    aspect-ratio: 9/16;
}

.gallery-grid[aria-label*="COWS ROBOT"] .shot.shot-portrait img {
    width: 200px;
    height: 360px;
    aspect-ratio: 9/16;
    object-fit: cover;
}

/* Format portrait réduit pour COWS BARON Color Pass */
.gallery-grid[aria-label*="COWS BARON"] .shot.shot-portrait-small {
    width: 320px;
    height: 568px;
    min-height: auto;
    aspect-ratio: 9/16;
}

.gallery-grid[aria-label*="COWS BARON"] .shot.shot-portrait-small img {
    width: 320px;
    height: 568px;
    aspect-ratio: 9/16;
    object-fit: cover;
}

/* Style arrondi pour le label TEMPLATE sur la carte hero MOONSHOT CGI */
.gallery-hero[aria-label*="MOONSHOT CGI"] .shot span {
    border: 1px solid var(--border);
    background: var(--card);
    padding: 0.45rem 0.75rem;
    font-size: 0.84rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Style arrondi pour les labels MOONSHOT CGI (comme les tags MAYA) */
.gallery-grid[aria-label*="MOONSHOT CGI"] .shot span {
    border: 1px solid var(--border);
    background: var(--card);
    padding: 0.45rem 0.75rem;
    font-size: 0.84rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Vidéos MOONSHOT CGI en format plus petit */
.gallery-grid[aria-label*="MOONSHOT CGI"] .shot {
    width: 495px;
    height: 278px;
    min-height: auto;
}

.gallery-grid[aria-label*="MOONSHOT CGI"] .shot video {
    width: 495px;
    height: 278px;
    object-fit: cover;
}

/* Style arrondi pour les labels OSCAR MISCHAPS (comme les tags MAYA) */
.gallery-grid[aria-label*="OSCAR MISCHAPS"] .shot span {
    border: 1px solid var(--border);
    background: var(--card);
    padding: 0.45rem 0.75rem;
    font-size: 0.84rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Style arrondi pour les labels ASSASSIN BUST */
.gallery-grid[aria-label*="ASSASSIN BUST"] .shot span {
    border: 1px solid var(--border);
    background: var(--card);
    padding: 0.45rem 0.75rem;
    font-size: 0.84rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Layout horizontal pour ASSASSIN BUST - images côte à côte 495x278 */
.gallery-grid[aria-label*="ASSASSIN BUST"] {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.gallery-grid[aria-label*="ASSASSIN BUST"] .shot {
    width: 495px;
    height: 278px;
    min-height: auto;
    flex: 0 0 auto;
}

.gallery-grid[aria-label*="ASSASSIN BUST"] .shot img {
    width: 495px;
    height: 278px;
    object-fit: cover;
}


.gallery-grid {
    padding: 0 0 3rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.gallery-grid .shot {
    flex: 0 0 max(240px, calc((100% - 5 * 1rem) / 6));
    min-height: 280px;
    border-radius: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid .shot:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(255, 140, 66, 0.15);
}

.shot span {
    position: absolute;
    left: 1rem;
    bottom: 0.8rem;
    font-size: 0.78rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #d4d4d4;
    background: var(--card);
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.shot-1 { grid-area: a; min-height: 560px; }
.shot-2 { grid-area: b; }
.shot-3 { grid-area: c; }

.breakdown-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 0 3rem;
    align-items: stretch;
}

.breakdown-split__hero {
    min-height: 0;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: linear-gradient(145deg, #181818 0%, #101010 55%, #141227 100%);
    position: relative;
}

.breakdown-split__hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.breakdown-split__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-content: start;
}

.shot--orange {
    background: linear-gradient(145deg, #1f1208 0%, #150e04 55%, #1a1005 100%);
}

@media (max-width: 768px) {
    .breakdown-split {
        grid-template-columns: 1fr;
    }
    .breakdown-split__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.section {
    padding-top: 3rem;
    padding-bottom: 2.6rem;
}

.section h2 {
    font-family: "Syne", sans-serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    margin-bottom: 0.8rem;
    text-align: center;
}

.section p {
    color: #cfcfcf;
    max-width: none;
}

.slider {
    margin-top: 1rem;
    display: grid;
    gap: 0.75rem;
}

.slider-frame {
    min-height: 520px;
    position: relative;
}

.slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.9);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    z-index: 2;
    line-height: 1;
    font-size: 1.35rem;
}

.slider-arrow--prev { left: 14px; }
.slider-arrow--next { right: 14px; }

.slider-arrow:hover,
.slider-arrow:focus-visible {
    border-color: rgba(255, 140, 66, 0.9);
    color: rgba(255, 140, 66, 0.95);
    background: rgba(10, 10, 10, 0.65);
    outline: none;
    transform: translateY(-50%) scale(1.04);
}

.slider-btn {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--primary);
    padding: 0.55rem 0.95rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    border-radius: var(--radius-md);
}

.slider-btn:hover,
.slider-btn:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
    transform: translateY(-1px);
}

.slider-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.slider-dot[aria-selected="true"] {
    background: rgba(255, 140, 66, 0.8);
    border-color: rgba(255, 140, 66, 0.9);
    transform: scale(1.2);
}

/* Fullscreen lightbox (project pages) */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
}

.lightbox.is-open {
    display: flex;
}

.lightbox__media {
    max-width: 92vw;
    max-height: 92vh;
    width: auto;
    cursor: pointer;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(20, 20, 20, 0.35);
}

.lightbox__close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
    border-color: rgba(255, 140, 66, 0.9);
    color: rgba(255, 140, 66, 0.95);
    background: rgba(10, 10, 10, 0.65);
    outline: none;
    transform: scale(1.04);
}

/* Navigation arrows for lightbox */
.lightbox__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.9);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    z-index: 10000;
    font-size: 1.5rem;
    line-height: 1;
}

.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
    border-color: rgba(255, 140, 66, 0.9);
    color: rgba(255, 140, 66, 0.95);
    background: rgba(10, 10, 10, 0.65);
    outline: none;
    transform: translateY(-50%) scale(1.04);
}

body.lightbox-open {
    overflow: hidden;
}

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
}

.stack span {
    border: 1px solid var(--border);
    background: var(--card);
    padding: 0.45rem 0.75rem;
    font-size: 0.84rem;
}

@media (max-width: 900px) {
    .meta { grid-template-columns: 1fr; }
    .gallery {
        grid-template-columns: 1fr;
        grid-template-areas: "a" "b" "c";
    }
    .shot-1 { min-height: 280px; }
    .gallery-hero .shot { min-height: 360px; }
    .gallery-grid .shot { flex: 0 0 max(45%, calc((100% - 1rem) / 2)); }
    .slider-frame { min-height: 320px; }
}
