:root {
    /* --- DIETER RAMS PALETTE --- */
    --rams-orange: oklch(65% 0.28 35); 
    --rams-off-white: oklch(97% 0 0);
    --rams-white: oklch(100% 0 0);
    --rams-grey: oklch(25% 0 0);
    --rams-black: oklch(5% 0 0); 
    --rams-footer-bg: oklch(92% 0 0);
    
    /* Dark Mode Variables */
    --rams-dark-bg: oklch(18% 0 0);
    --rams-dark-card: oklch(22% 0 0);
    --rams-dark-text: oklch(95% 0 0);
    --rams-dark-footer: oklch(12% 0 0);

    /* --- MAPPING --- */
    --bg-color: var(--rams-off-white);
    --text-color: var(--rams-grey);
    --footer-bg: var(--rams-footer-bg);
    
    --primary--darkest: var(--rams-orange);
    --primary--darker: var(--rams-white);   
    --secondary: var(--rams-grey);
    --cursor-size: 24px;
    
    /* --- ANIMATION SETTINGS --- */
    --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
    --trans-dur: 0.6s; 
    
    /* Type */
    --mono: "IBM Plex Mono", monospace;
    --sans: "IBM Plex Sans", sans-serif;
    
    /* Spacing */
    --container--block-padding: 3.25rem;
    --container--inline-padding: 4vw;
}

/* --- DARK MODE --- */
html[data-dark="true"] {
    --bg-color: var(--rams-dark-bg);
    --text-color: var(--rams-dark-text);
    --footer-bg: var(--rams-dark-footer);
    --primary--darker: var(--rams-dark-card); 
    --secondary: var(--rams-dark-text);
}

/* --- RESET & CURSOR FIX --- */
*, *:before, *:after { 
    box-sizing: border-box; 
    cursor: none !important; 
}

html {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--sans);
    min-height: 100vh;
    transition: background 0.5s ease, color 0.5s ease;
}

body {
    margin: 0;
    overflow-y: scroll; 
    overflow-x: hidden; 
    display: block; 
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

button {
    cursor: none !important;
    font-family: inherit;
}

/* --- CURSOR LOGIC (DESKTOP ONLY) --- */
@media (hover: hover) and (pointer: fine) {
    *, *:before, *:after { cursor: none !important; }
    
    .cursor {
        width: var(--cursor-size); height: var(--cursor-size); border-radius: 50%;
        position: fixed; left: 0; top: 0; transform: translate(-50%, -50%); 
        background: white; 
        mix-blend-mode: difference;
        pointer-events: none; z-index: 10001;
        display: block;
    }
}

/* HIDE CUSTOM CURSOR ON MOBILE */
@media (hover: none) {
    .cursor { display: none; }
    button, a { cursor: pointer; }
}

/* The Fixed Scroll Wrapper */
.scroll-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* --- OVERLAY & VIEWS --- */
.overlay {
    grid-area: 1 / -1; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10000; pointer-events: none; opacity: 0; display: grid;
    grid-template-columns: repeat(var(--columns, 10), 1fr);
}
.overlay div { background: var(--primary--darkest); margin: 0; padding: 0; border: none; }

.landing-view { display: block; opacity: 1; transition: opacity 0.1s; }
.portfolio-view { display: none; opacity: 0; }
.view--active { display: block !important; opacity: 1 !important; pointer-events: auto; }
.view--hidden { display: none !important; opacity: 0 !important; pointer-events: none; }

.portfolio-controls {
    width: min(1200px, calc(100% - (2 * var(--container--inline-padding))));
    margin: 0 auto 1rem;
    padding: 0;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
}

.back-to-home {
    font-family: var(--sans); font-weight: 600; text-transform: uppercase;
    background: transparent; border: none; font-size: 1rem;
    display: flex; align-items: center; gap: 0.5rem; color: var(--text-color);
}
.back-to-home:hover { color: var(--primary--darkest); }

/* --- HEADER & MOBILE NAV --- */
.portfolio-header {
    width: min(1200px, calc(100% - (2 * var(--container--inline-padding))));
    margin: 1.5rem auto;
    padding: 1.25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 9990;
    gap: clamp(0.5rem, 2vw, 1.5rem);
}

.logo-container { 
    display: flex; align-items: center; gap: 1.5rem; text-decoration: none; 
    background: transparent; border: none; padding: 0; color: var(--text-color);
    position: relative; z-index: 9992;
}
.portfolio-header h1 {
    font-family: var(--sans); font-size: 1.8rem; font-weight: 700; margin: 0; letter-spacing: 0.05em; text-transform: uppercase;
}

.logo-mark { width: 50px; height: 50px; position: relative; }
.circle { background-color: var(--primary--darkest); border-radius: 50%; position: absolute; }
.c1 { width: 24px; height: 24px; top: 0; left: 0; }
.c2 { width: 36px; height: 36px; bottom: 0; left: 0; }
.c3 { width: 20px; height: 20px; top: 5px; left: 15px; z-index: 2; border: 2px solid var(--bg-color); transition: border-color 0.5s ease; }

/* Desktop Nav */
.header-nav {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    align-items: center;
}

.button.nav-link, 
.button {
    border-radius: 100px; padding: 0.65em 1.4em; border: 1px solid var(--text-color);
    transition: 0.2s; position: relative; z-index: 10;
    background: transparent; color: var(--text-color);
    font-size: 0.9rem; text-transform: uppercase; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; line-height: 1.2; text-align: center;
}
.button:hover { background: var(--text-color); color: var(--bg-color); }

/* --- BURGER MENU --- */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 9992;
    gap: 6px;
    padding: 0;
}

.burger-line {
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.3s var(--ease-smooth), opacity 0.3s ease;
    transform-origin: center;
}

/* MOBILE STYLES (max-width: 768px) */
@media screen and (max-width: 768px) {
    .portfolio-header { padding-top: 1.25rem; padding-bottom: 1.25rem; margin-bottom: 1rem; }
    .burger-menu { display: flex; }
    .portfolio-header h1 { font-size: 1.2rem; }
    .logo-mark { width: 40px; height: 40px; }
    .c1 { width: 18px; height: 18px; }
    .c2 { width: 28px; height: 28px; }
    .c3 { width: 16px; height: 16px; top: 4px; left: 12px; }

    /* Nav Drawer Logic */
    .header-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 9991;
        
        opacity: 0;
        pointer-events: none;
        transform: translateY(-20px);
        transition: opacity 0.4s ease, transform 0.4s var(--ease-smooth);
    }

    .header-nav.nav-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    /* Burger Animation -> X */
    .burger-menu.open .line-1 {
        transform: translateY(4px) rotate(45deg);
    }
    .burger-menu.open .line-2 {
        transform: translateY(-4px) rotate(-45deg);
    }
}

/* --- LANDING PAGE --- */
.landing-main {
    min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 0 var(--container--inline-padding);
}
.split-container { display: flex; align-items: center; justify-content: center; gap: 4vw; width: 100%; }
.split-line { width: 2px; height: 120px; background-color: var(--text-color); opacity: 0.3; }

.big-link {
    font-family: var(--sans); 
    font-weight: 900; 
    font-size: clamp(2.5rem, 5vw, 6rem);
    text-transform: uppercase; 
    line-height: 1; 
    position: relative; 
    transition: color 0.3s ease;
    background: transparent; border: none; padding: 0; margin: 0;
    color: var(--text-color); 
}

.big-link:hover { color: var(--primary--darkest); }
html[data-dark="true"] .big-link:hover { color: var(--primary--darkest); -webkit-text-stroke: 0; }

@media screen and (max-width: 900px) {
    .split-container { flex-direction: column; gap: 3rem; }
    .split-line { width: 100px; height: 2px; }
}

/* --- FOOTER --- */
.site-footer {
    background-color: var(--footer-bg); padding: 4rem var(--container--inline-padding); margin-top: auto; display: flex; flex-direction: column; gap: 4rem;
    transition: background-color 0.5s ease;
}
.footer-columns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.col h4 { font-family: var(--sans); font-weight: 700; text-transform: uppercase; margin-bottom: 1.5rem; font-size: 0.9rem; }
.col ul li { margin-bottom: 0.8rem; }
.col ul li a { font-family: var(--sans); font-size: 0.95rem; opacity: 0.7; }
.col ul li a:hover { opacity: 1; color: var(--primary--darkest); }
.line-left { border-left: 1px solid color-mix(in srgb, var(--text-color), transparent 85%); padding-left: 2rem; }

.footer-bottom { 
    display: flex; justify-content: space-between; align-items: center; 
    border-top: 1px solid color-mix(in srgb, var(--text-color), transparent 90%); 
    padding-top: 2rem; 
}
.copyright-text {
    display: flex; gap: 1rem; align-items: center;
    font-family: var(--mono); font-size: 0.8rem; opacity: 0.6; font-weight: 500;
}
.socials { display: flex; gap: 1.5rem; font-size: 1.5rem; }

@media screen and (max-width: 900px) {
    .footer-columns { grid-template-columns: 1fr 1fr; }
    .line-left { border: none; padding: 0; }
    .footer-bottom { flex-direction: column-reverse; gap: 2rem; }
}

/* --- PORTFOLIO GRID SYSTEM --- */
main { flex: 1; width: 100%; }

.portfolio-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 0 var(--container--inline-padding);
    margin-bottom: 4rem;
}

.portfolio-section.is-hidden {
    display: none;
}

.section-header {
    width: min(1200px, calc(100% - (2 * var(--container--inline-padding))));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.section-eyebrow {
    margin: 0;
    font-family: var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
    opacity: 0.6;
}

.section-title {
    margin: 0;
    font-family: var(--sans);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 1.4rem;
}

.grid--container {
    padding: 0 var(--container--inline-padding);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px 20px; 
    margin: 0 auto;
    width: min(1200px, calc(100% - (2 * var(--container--inline-padding))));
}

.portfolio-section .grid--container {
    padding: 0;
}

@media screen and (max-width: 1024px) {
    .grid--container { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 768px) {
    .grid--container { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px; 
    }
    :root { --container--inline-padding: 1rem; }
}

/* CARD STYLES */
.grid--item {
    --preview-height: 320px;
    background: var(--primary--darker); 
    color: var(--secondary); 
    
    /* Slightly rounded at rest (12px), animates to 24px on hover */
    border-radius: 12px; 
    
    overflow: hidden; 
    position: relative;
    display: grid; 
    grid-template-rows: var(--preview-height) auto;
    
    transition: 
        transform var(--trans-dur) var(--ease-smooth),
        box-shadow var(--trans-dur) var(--ease-smooth),
        border-radius var(--trans-dur) var(--ease-smooth),
        background-color 0.3s ease;
    
    box-shadow: 0 0 0 rgba(0,0,0,0);
    will-change: transform, border-radius;
}

@media screen and (max-width: 768px) {
    .grid--item { --preview-height: 200px; }
}

.grid--item:hover {
    transform: translateY(-8px); 
    z-index: 2;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px color-mix(in srgb, var(--secondary), transparent 85%);
}

html[data-dark="true"] .grid--item:hover {
    background: var(--rams-black); 
    color: var(--rams-white);
}

.preview--container {
    position: relative; 
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    background: var(--bg-color);
    border-radius: inherit;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.preview-image-wrapper { width: 100%; height: 100%; position: relative; overflow: hidden; }

.preview-image {
    width: 100%; 
    height: 120% !important; 
    position: absolute; 
    top: -10%; 
    left: 0;
    background-size: cover; 
    background-position: center;
    filter: grayscale(100%); 
    mix-blend-mode: multiply; 
    opacity: 0.9;
    
    transition: filter 0.6s ease, opacity 0.6s ease, mix-blend-mode 0.6s ease;
    will-change: transform;
}

.grid--item:hover .preview-image {
    filter: none; mix-blend-mode: normal; opacity: 1;
}

html[data-dark="true"] .preview-image {
    filter: grayscale(100%); mix-blend-mode: normal; opacity: 1;
}
html[data-dark="true"] .grid--item:hover .preview-image {
    filter: none;
}

.meta--container {
    position: absolute; bottom: 0; left: 0; display: flex; z-index: 2;
}

/* UPDATED: Removed border-top-right-radius and set border-radius to 0px for sharp corners */
.issue { background: var(--primary--darkest); color: var(--rams-white); padding: 4px 12px; font-family: var(--mono); font-size: 0.75rem; border-radius: 0px; }
.page { background: var(--primary--darker); color: var(--secondary); padding: 4px 12px; font-family: var(--mono); font-size: 0.75rem; border-radius: 0px; }

.content--container { padding: 1.5rem 1.5rem 2rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

@media screen and (max-width: 768px) {
    .content--container { padding: 1rem; gap: 0.5rem; }
    .title--text { font-size: 1.1rem; }
}

.title--text {
    font-size: 1.4rem; font-weight: 500; line-height: 1.2; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.tags--container { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag { font-size: 0.75rem; border: 1px solid currentColor; border-radius: 50px; padding: 2px 10px; opacity: 0.6; }

/* HOVER OPTIONS */
.hover--options {
    max-height: 0; opacity: 0; overflow: hidden; display: flex; gap: 0.5rem; padding-top: 0; 
    transition: max-height var(--trans-dur) var(--ease-smooth), opacity var(--trans-dur) ease, padding-top var(--trans-dur) var(--ease-smooth);
}

.grid--item:hover .hover--options { max-height: 60px; opacity: 1; padding-top: 1rem; }
.series.button { font-size: 0.8rem; background: color-mix(in srgb, currentColor, transparent 90%); }

/* --- THEME TOGGLE (SUN / MOON) --- */
.theme-toggle {
    position: fixed; bottom: 2rem; right: 2rem; z-index: 9998; 
    background-color: transparent; border: none; padding: 0;
    cursor: pointer; outline: none;
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    color: var(--text-color); transition: color 0.3s ease, transform 0.5s var(--ease-smooth);
}
.theme-toggle:hover { color: var(--primary--darkest); transform: scale(1.1); }
.toggle-icon { position: relative; width: 24px; height: 24px; }
.sun, .moon {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    transition: transform 0.5s var(--ease-smooth), opacity 0.5s var(--ease-smooth);
}
[aria-pressed="true"] .sun { transform: rotate(0deg) scale(1); opacity: 1; }
[aria-pressed="true"] .moon { transform: rotate(90deg) scale(0); opacity: 0; }
[aria-pressed="false"] .sun { transform: rotate(-90deg) scale(0); opacity: 0; }
[aria-pressed="false"] .moon { transform: rotate(0deg) scale(1); opacity: 1; }

/* Make hover-bounds accessible to mouse events even if container is relative */
[data-hover] [data-hover-bounds] { pointer-events: auto; }

/* --- PROJECT DETAIL PAGE STYLES --- */

/* --- PROJECT DETAIL PAGE STYLES --- */

.project-main {
    padding-bottom: 4rem;
}

/* 1. HERO SECTION */
.project-hero {
    position: relative;
    width: 100%;
    height: 65vh;
    overflow: hidden;
    margin-bottom: 4rem;
    display: flex;
    align-items: flex-end; 
}

.hero-image {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    filter: none; mix-blend-mode: normal; opacity: 1;
    z-index: 0;
}
html[data-dark="true"] .hero-image { filter: none; mix-blend-mode: normal; opacity: 0.9; }

.hero-content {
    position: relative;
    z-index: 2;
    padding: var(--container--inline-padding);
    width: 100%;
    background: linear-gradient(to top, var(--bg-color) 0%, transparent 100%);
    padding-top: 8rem;
}

.project-title {
    font-family: var(--sans);
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 1rem 0;
    line-height: 1;
}

.project-meta {
    display: flex; gap: 1rem;
}

.meta-tag {
    font-family: var(--mono);
    font-size: 0.85rem;
    border: 1px solid currentColor;
    padding: 0.4em 1em;
    border-radius: 50px;
    text-transform: uppercase;
}

/* 2. TEXT CONTENT */
.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--container--inline-padding);
}

.intro-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.intro-text .lead {
    font-size: 1.4rem;
    font-weight: 500;
}

.project-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid color-mix(in srgb, var(--text-color), transparent 85%);
}

.spec-item { display: flex; flex-direction: column; gap: 0.5rem; }
.spec-item .label { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; opacity: 0.5; }
.spec-item .value { font-family: var(--sans); font-weight: 600; }

@media screen and (max-width: 768px) {
    .project-specs { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* 3. VIDEO SECTION */
.container-wide {
    max-width: 1400px;
    margin: 6rem auto;
    padding: 0 var(--container--inline-padding);
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: var(--primary--darker);
}

.video-wrapper video {
    width: 100%; height: 100%; object-fit: cover;
}

.play-overlay {
    position: absolute;
    bottom: 2rem; left: 2rem;
    display: flex; align-items: center; gap: 1rem;
    background: rgba(255,255,255,0.9);
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}
html[data-dark="true"] .play-overlay { background: rgba(0,0,0,0.8); color: white; }

.play-icon {
    width: 32px; height: 32px;
    background: var(--primary--darkest);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.8rem;
}

/* 4. GALLERY */
.gallery-grid {
    column-count: 2;
    column-gap: 2rem;
}
.gallery-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    border-radius: 0px;
    overflow: hidden;
    position: relative;
    transition: border-radius var(--trans-dur) var(--ease-smooth);
}
.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s var(--ease-smooth);
}
.gallery-item:hover {
    border-radius: 24px;
    z-index: 2;
}
.gallery-item:hover img {
    transform: scale(1.02);
}

@media screen and (max-width: 768px) {
    .gallery-grid { column-count: 1; }
    .gallery-item { width: 100%; }
}

/* Advertising placeholder */
.section-placeholder {
    padding: 3rem 0;
    text-align: center;
    font-family: var(--mono);
    letter-spacing: 0.08em;
    opacity: 0.7;
}

/* ADVERTISING FLOATING CARDS */
.ad-gallery {
    position: relative;
    width: 100%;
    min-height: 180vh;
    display: flex;
    justify-content: center;
    padding-top: 100px;
    perspective: 1500px;
}

.ad-gallery .card {
    position: absolute;
    width: 260px;
    aspect-ratio: 3/4;
    cursor: pointer;
    left: 50%;
    top: 150px;
    margin-left: -130px;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    z-index: 1;
    overflow: visible;
}

.ad-gallery .card-lift {
    width: 100%;
    height: 100%;
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
    pointer-events: none;
    overflow: visible;
}

.ad-gallery .card-content {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: float-idle 6s ease-in-out infinite;
    overflow: hidden;
    background: var(--rams-white);
    transform: translateZ(0);
    pointer-events: auto;
    position: absolute;
    top: 0;
    left: 0;
}

.ad-gallery .card-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-gallery .card-overlay {
    position: absolute;
    inset: -40px -30px -40px -30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    transform: translateZ(80px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.1s ease-out;
    overflow: visible;
}

.ad-gallery .card:hover {
    z-index: 100 !important;
}
.ad-gallery .card:hover .card-content {
    box-shadow: 0 40px 80px rgba(0,0,0,0.4);
    transition: box-shadow 0.3s ease;
}
.ad-gallery .card:hover .card-overlay {
    opacity: 1;
}

.ad-gallery .project-name {
    font-family: var(--sans);
    font-weight: 800;
    font-size: clamp(3.4rem, 9vw, 5.2rem);
    line-height: 0.8;
    text-transform: uppercase;
    color: #111;
    text-shadow: 3px 3px 0 var(--rams-white), -3px -3px 0 var(--rams-white);
    transform: translate(-40px, -70px) rotate(-12deg);
}

.ad-gallery .card-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    transform: translate(-18px, 10px) rotate(2deg);
}

.ad-gallery .badge-year,
.ad-gallery .badge-cat {
    font-family: var(--mono);
    font-size: clamp(1rem, 2.6vw, 1.3rem);
    text-transform: uppercase;
    padding: 0.4rem 0.85rem;
    border-radius: 2px;
    border: 2px solid #000;
    background: var(--rams-white);
    color: #000;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.15);
}

.ad-gallery .badge-year {
    background: var(--primary--darkest);
    color: var(--rams-white);
    border-color: var(--primary--darkest);
}

.ad-gallery .card:nth-child(1) { transform: translate(-160px, 0px) rotate(-8deg); z-index: 1; }
.ad-gallery .card:nth-child(2) { transform: translate(140px, 120px) rotate(6deg); z-index: 2; }
.ad-gallery .card:nth-child(3) { transform: translate(-100px, 350px) rotate(-4deg); z-index: 3; }
.ad-gallery .card:nth-child(4) { transform: translate(160px, 500px) rotate(10deg); z-index: 4; }
.ad-gallery .card:nth-child(5) { transform: translate(-180px, 700px) rotate(-12deg); z-index: 5; }
.ad-gallery .card:nth-child(6) { transform: translate(80px, 850px) rotate(4deg); z-index: 6; }

.ad-gallery .card:nth-child(1) .card-content { animation-delay: 0s; }
.ad-gallery .card:nth-child(2) .card-content { animation-delay: -1.5s; }
.ad-gallery .card:nth-child(3) .card-content { animation-delay: -3s; }
.ad-gallery .card:nth-child(4) .card-content { animation-delay: -0.5s; }
.ad-gallery .card:nth-child(5) .card-content { animation-delay: -2s; }
.ad-gallery .card:nth-child(6) .card-content { animation-delay: -4s; }

@keyframes float-idle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@media screen and (max-width: 768px) {
    .ad-gallery {
        min-height: auto;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.5rem;
        padding: 2rem 0 3rem;
        perspective: none;
    }
    .ad-gallery .card {
        position: relative;
        left: auto;
        top: auto;
        margin: 0;
        transform: none !important;
        width: 100%;
        max-width: 280px;
        justify-self: center;
    }
    .ad-gallery .card-lift { pointer-events: auto; }
}
.card:hover { z-index: 100; }
.card:hover .card-content {
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    transition: box-shadow 0.3s ease;
    transform: scale(1.25);
}
.card:hover .card-overlay {
    transform: translateZ(60px);
}

.card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.75rem 0.9rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.card:hover .card-overlay { opacity: 1; }

.project-name {
    font-family: var(--sans);
    font-weight: 800;
    font-size: clamp(2.8rem, 7vw, 4.2rem);
    line-height: 0.85;
    text-transform: uppercase;
    color: #111;
    text-shadow: 3px 3px 0 var(--rams-white), -3px -3px 0 var(--rams-white);
    transform: translate(-18px, -24px) rotate(-8deg);
}

.card-badges {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    transform: translate(-6px, 14px);
}

.badge-year,
.badge-cat {
    font-family: var(--mono);
    font-size: clamp(1rem, 2.4vw, 1.25rem);
    text-transform: uppercase;
    padding: 0.35rem 0.8rem;
    border-radius: 2px;
    border: 1px solid currentColor;
    background: var(--rams-white);
    color: #000;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.12);
}

.badge-year {
    background: var(--primary--darkest);
    color: var(--rams-white);
    border-color: var(--primary--darkest);
}


@media screen and (max-width: 768px) {
    .gallery-container {
        min-height: auto;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.5rem;
        padding: 2rem 0 3rem;
    }
    .card {
        position: relative;
        left: auto;
        top: auto;
        margin: 0;
        transform: none !important;
        width: 100%;
        max-width: 260px;
        justify-self: center;
    }
    .card-lift { pointer-events: auto; }
}

/* CASE OVERVIEW SPLIT */
.case-overview {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: start;
    margin: 4rem auto;
}
.case-overview figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}
.case-overview img {
    width: 100%;
    display: block;
    border-radius: 12px;
}
.case-overview .brown-img {
    max-width: 420px;
}
.case-copy {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.case-copy .poster-img {
    width: 100%;
    max-width: 520px;
    border-radius: 12px;
    align-self: flex-start;
}
.case-overview .case-copy {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.case-overview .case-copy h4 {
    margin: 0;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    opacity: 0.7;
}
@media screen and (max-width: 1024px) {
    .case-overview { grid-template-columns: 1fr; }
}

/* 5. NEXT PROJECT */
.next-project {
    margin-top: 8rem;
    text-align: center;
}

.next-project .label {
    display: block;
    font-family: var(--mono);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.next-project .big-link {
    font-size: clamp(2rem, 5vw, 4rem);
}

/* PROCESS BOOK MODAL */
.process-book-block {
    display: flex;
    justify-content: center;
    margin: 2.5rem 0 1rem;
}

.process-book-shell {
    position: relative;
    width: min(460px, 100%);
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: url(#goo);
}

.gooey-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.blob-btn {
    position: absolute;
    width: 220px;
    height: 64px;
    border-radius: 999px;
    border: none;
    background: var(--primary--darkest);
    color: transparent;
    font-family: var(--sans);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 18px 38px color-mix(in srgb, var(--primary--darkest), transparent 80%);
    pointer-events: auto;
}

.process-book-shell.active .blob-btn {
    width: 150px;
    color: var(--rams-white);
}

.process-book-shell.active .view-btn { transform: translateX(-110px); }
.process-book-shell.active .download-btn { transform: translateX(110px); }

.initial-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--rams-white);
    font-family: var(--sans);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.25s ease 0.25s;
    white-space: nowrap;
    pointer-events: none;
}

.process-book-shell:not(.active) .initial-text {
    opacity: 1;
    transition-delay: 0.25s;
}

.process-book-shell.active .initial-text {
    opacity: 0;
    transition-delay: 0s;
}

.process-close-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--text-color), transparent 50%);
    background: var(--bg-color);
    color: var(--text-color);
    display: grid;
    place-items: center;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s var(--ease-smooth);
}

.process-book-shell.active .process-close-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.pdf-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    z-index: 40000;
}

.pdf-lightbox.is-open { display: flex; }

.pdf-lightbox__content {
    position: relative;
    width: min(1200px, 90vw);
    height: min(820px, 88vh);
    background: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0,0,0,0.4);
}

.pdf-lightbox__content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-lightbox__close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.1rem;
    display: grid;
    place-items: center;
}

.lightbox-open { overflow: hidden; }
.process-video {
    margin-top: 2rem;
}
.video-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    border: 1px dashed color-mix(in srgb, var(--text-color), transparent 70%);
    display: grid;
    place-items: center;
    color: color-mix(in srgb, var(--text-color), transparent 20%);
    font-family: var(--mono);
    letter-spacing: 0.05em;
}
