:root {
    --bg-color: #050505;
    --text-color: #f1f1f1;
    --accent-color: #ff3366;
    --font-main: 'Outfit', sans-serif;

    /* Fluid typography */
    --step--2: clamp(0.6944rem, 0.6713rem + 0.1157vw, 0.76rem);
    --step--1: clamp(0.8331rem, 0.7831rem + 0.2503vw, 0.975rem);
    --step-0: clamp(1rem, 0.913rem + 0.4348vw, 1.25rem);
    --step-1: clamp(1.2rem, 1.0626rem + 0.6868vw, 1.5906rem);
    --step-2: clamp(1.44rem, 1.2338rem + 1.0308vw, 2.0238rem);
    --step-3: clamp(1.7281rem, 1.4287rem + 1.4967vw, 2.5744rem);
    --step-4: clamp(2.0738rem, 1.6493rem + 2.1221vw, 3.2731rem);
    --step-5: clamp(2.4881rem, 1.8973rem + 2.9543vw, 4.1613rem);
    --step-huge: clamp(2.5rem, 1rem + 6vw, 6.5rem);
}

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

::selection {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow-x: hidden;
    cursor: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

/* Custom Cursor */
.cursor {
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: transparent;
}

.cursor-follower.active {
    width: 80px;
    height: 80px;
    background-color: var(--text-color);
    border-color: transparent;
    color: var(--bg-color);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 4px 20px rgba(0,0,0,0.5); /* Sombra para destacar contra a imagem */
}

.logo {
    font-size: var(--step-1);
    font-weight: 700;
    letter-spacing: 2px;
}

.logo span {
    font-weight: 300;
    opacity: 0.7;
}

.nav-location {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--step--1);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    pointer-events: none;
}

.menu-btn {
    font-size: var(--step-0);
    font-weight: 500;
    cursor: none;
    z-index: 200;
}

/* Overlay Menu */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 150;
    pointer-events: none;
    visibility: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.menu-overlay-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--text-color);
    /* Light background */
    transform: translateY(-100%);
    z-index: 1;
}

.menu-inner {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 2;
    padding: 6rem 0;
}

.menu-close-btn {
    position: fixed;
    top: 2rem;
    right: 4rem;
    font-size: var(--step-0);
    font-weight: 500;
    color: var(--accent-color);
    /* Pink cross */
    cursor: none;
    z-index: 1000;
}

.menu-links {
    list-style: none;
    text-align: center;
    margin: auto; /* Graceful centering that allows scrolling */
    width: 100%;
    padding: 2rem 0;
}

.menu-links li {
    overflow: hidden;
    margin: 1rem 0;
}

.menu-links a {
    font-size: var(--step-huge);
    font-weight: 900;
    text-transform: uppercase;
    color: var(--accent-color);
    /* Pink text */
    text-decoration: none;
    display: inline-block;
    transform: translateY(110%);
}

.menu-links a:hover {
    color: var(--bg-color);
    /* Dark contrast on hover */
    -webkit-text-stroke: 1px var(--bg-color);
}

/* Case Study Modal */
.case-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    pointer-events: none;
    visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.case-modal-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    opacity: 0;
}

.case-close {
    position: fixed;
    top: 2.2rem;
    left: 4rem;
    z-index: 1001;
    font-size: var(--step-0);
    font-weight: 500;
    color: var(--text-color);
    mix-blend-mode: difference;
    cursor: none;
    opacity: 0;
}

.case-modal-content-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    z-index: 2;
    padding-top: 15vh;
}

.case-modal-content {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 2rem;
    opacity: 0;
    transform: translateY(40px);
    text-align: left;
}

/* Case Body Text — Narrative Layout */
.case-body-text {
    margin-bottom: 5rem;
    border-top: 1px solid #222;
    padding-top: 3rem;
}

.case-meta-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.case-agency-name {
    font-size: var(--step--1);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
}

.case-role-badge {
    font-size: var(--step--1);
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.case-role-badge strong {
    color: #ccc;
    font-weight: 500;
}

.case-paragraphs p {
    font-size: var(--step-0);
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 1.5rem;
}

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

.case-credits-block {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #222;
}

.case-credits-block p {
    font-size: var(--step--1);
    color: #666;
    line-height: 1.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.case-modal-image {
    width: 100%;
    margin: 4rem 0;
    border-radius: 12px;
    overflow: hidden;
}

.case-modal-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Section Common */
.section {
    padding: 8rem 4rem;
    min-height: 100vh;
}

.hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    padding-top: 20vh;
    padding-bottom: 6rem;
    min-height: 90vh; /* Reduced from 100vh to prevent excessive blowout on large monitors */
    background-image: url('assets/BG-PG-PRINCIPAL.png');
    background-size: cover;
    background-position: center top; /* Keeps the important top part focused */
    background-repeat: no-repeat;
    background-attachment: scroll;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(5,5,5,0.1) 0%, rgba(5,5,5,0.3) 70%, rgba(5,5,5,1) 100%);
    z-index: 1;
}

.hero-content, .hero-sub, .hero-title {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: var(--step-huge);
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    display: none; /* Hidden since text is in the image */
}

.line {
    overflow: hidden;
    display: block;
}

.word {
    display: inline-block;
    transform: translateY(110%);
}

.hero-sub {
    margin-top: 4rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: var(--step-1);
    opacity: 0;
    transform: translateY(20px);
}

.hero-sub p {
    max-width: 400px;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 4px 20px rgba(0,0,0,0.8);
}

.scroll-indicator {
    text-transform: uppercase;
    font-size: var(--step--1);
    letter-spacing: 1px;
}

.visual-placeholder {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 51, 102, 0.15) 0%, rgba(5, 5, 5, 1) 70%);
    position: absolute;
    top: 30%;
    right: 5%;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: pulse 8s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.5) translate(-100px, 100px);
    }
}

/* Skills Marquee */
.skills-marquee-section {
    padding: 1.5rem 0;
    overflow: hidden;
    background-color: transparent;
    margin-bottom: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 10;
}

.skills-marquee {
    white-space: nowrap;
    display: flex;
}

.skills-marquee-inner {
    display: flex;
    font-size: var(--step--1);
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    width: fit-content;
}

.skills-marquee-inner span {
    padding-right: 3rem;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.skills-marquee-inner span::after {
    content: '✦';
    color: var(--accent-color);
    font-size: 0.8em;
}

/* Case Studies - Light Theme */
.case-studies {
    background-color: #f8f9fa;
    color: #050505;
    position: relative;
    border-radius: 40px 40px 0 0;
    margin-top: -40px;
    z-index: 10;
    padding-top: 10rem;
}

.section-title {
    font-size: var(--step-4);
    font-weight: 700;
    margin-bottom: 4rem;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 2.5rem;
    row-gap: 6rem;
}

.work-item {
    cursor: none;
    position: relative;
}

.work-item:nth-child(even) {
    margin-top: 0;
}

.placeholder-img {
    width: 100%;
    aspect-ratio: 4/5;
    background-color: #111;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.placeholder-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-item:hover .placeholder-img {
    transform: scale(0.97);
}

.work-item:hover .placeholder-img img {
    transform: scale(1.05);
}

.work-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.work-info {
    margin-top: 3rem;
}

.work-info h3 {
    font-size: var(--step-0);
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: #111;
}

.work-info p {
    font-size: var(--step--1);
    color: var(--accent-color);
    font-weight: 500;
}

/* KVs Deck Section */
.kvs-deck-section {
    background-color: #f8f9fa;
    color: #050505;
    padding: 6rem 4rem 6rem; /* Balanced top and bottom padding */
    min-height: auto !important; /* Removes the excessive 100vh white space inherited from .section */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cards-deck-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    height: 380px; /* Horizontal shape */
    margin: 0 auto;
    cursor: pointer;
    perspective: 1200px;
}

.kv-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    transform-origin: 50% 100%;
    will-change: transform, opacity;
    overflow: hidden;
}

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

/* Marquee */
.marquee-section {
    padding: 8rem 0;
    overflow: hidden;
    background-color: var(--text-color);
    /* Pure white background */
    color: var(--accent-color);
    /* Pink Text */
    transform: rotate(-2deg);
    margin: 4rem -2rem;
    border-top: 2px solid #eee;
    border-bottom: 2px solid #eee;
}

.marquee {
    white-space: nowrap;
    display: flex;
}

.marquee-inner {
    display: flex;
    font-size: var(--step-5);
    font-weight: 900;
    text-transform: uppercase;
    width: fit-content;
}

.marquee-inner span {
    padding-right: 4rem;
}

/* Scroll Joke Section - Replaces Testimonials */
.scroll-joke-section {
    background-color: #f8f9fa;
    /* Light premium background */
    color: #111;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 50vh;
    /* Make it a bit taller to show off the bubbles */
    position: relative;
    overflow: hidden;
    /* Important so bubbles don't overflow the section causing scroll issues */
    z-index: 1;
}

/* Animated Game Center Style Bubbles */
.joke-bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    /* Soft gradient light blob effect */
    opacity: 0.6;
    z-index: -1;
    animation: floatBubble 15s infinite alternate ease-in-out;
    mix-blend-mode: multiply;
    /* Looks great blending with the white bg */
}

.bubble-1 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-color) 0%, rgba(255, 51, 102, 0) 70%);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.bubble-2 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #00d2ff 0%, rgba(0, 210, 255, 0) 70%);
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
    animation-duration: 18s;
}

.bubble-3 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #ffaa00 0%, rgba(255, 170, 0, 0) 70%);
    top: 30%;
    left: 40%;
    animation-delay: -10s;
    animation-duration: 20s;
}

.bubble-4 {
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, #9d00ff 0%, rgba(157, 0, 255, 0) 70%);
    bottom: 10%;
    left: 10%;
    animation-delay: -2s;
    animation-duration: 14s;
}

@keyframes floatBubble {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(5vw, -5vw) scale(1.1);
    }

    66% {
        transform: translate(-3vw, 8vw) scale(0.9);
    }

    100% {
        transform: translate(-5vw, -3vw) scale(1.05);
    }
}

.joke-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.joke-sub {
    font-size: var(--step-1);
    font-weight: 500;
    color: #888;
    margin-bottom: 2rem;
}

.joke-title {
    font-size: var(--step-4);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 4rem;
    text-transform: uppercase;
}

.bouncing-hand {
    font-size: var(--step-huge);
    display: inline-block;
    animation: bounce 2s infinite cubic-bezier(0.28, 0.84, 0.42, 1);
    transform-origin: center bottom;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0) scaleY(1);
    }

    50% {
        transform: translateY(20px) scaleY(0.9);
    }
}

/* Footer */
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: #000;
    border-top: 1px solid #111;
    padding-bottom: 8rem;
    padding-top: 8rem;
    min-height: auto !important; /* Removes flex center bleeding issue off the bottom of the page */
}

.cta {
    font-size: var(--step-4);
    margin-bottom: 2rem;
}

.big-link {
    font-size: var(--step-5);
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    position: relative;
    display: inline-block;
    margin-bottom: 4rem;
}

.big-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background-color: var(--accent-color);
    transition: width 0.4s ease;
}

.big-link:hover::after {
    width: 100%;
}

.social-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    /* Center horizontally on desktop too */
}

.social-links a {
    color: #fff;
    text-decoration: none;
    font-size: var(--step-0);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--accent-color);
}

.social-links svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.magnetic {
    display: inline-block;
    padding: 1rem;
}

/* About Page Specific Styles */
.about-page-hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding-top: 15vh;
}

.about-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: start;
}

.about-image {
    width: 100%;
    aspect-ratio: 4/5;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    position: sticky;
    top: 10vh;
}

.about-image > div {
    width: 100%;
    height: 100%;
    display: block !important;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0.9;
    filter: grayscale(0%);
    transition: filter 0.5s ease;
    display: block;
}

.about-image:hover img {
    filter: grayscale(100%);
}

.about-text h1 {
    font-size: var(--step-4);
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.1;
}

.about-text p {
    font-size: var(--step-0);
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.experience-section {
    padding: 8rem 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.experience-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    padding: 3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.experience-year {
    font-size: var(--step-2);
    font-weight: 700;
    color: var(--accent-color);
}

.experience-details h3 {
    font-size: var(--step-1);
    font-weight: 500;
    margin-bottom: 1rem;
    color: #fff;
}

.experience-details h4 {
    font-size: var(--step--1);
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.experience-details p {
    color: #aaa;
    line-height: 1.6;
    font-size: var(--step-0);
}

/* Notebook (max-width: 1440px) */
@media (max-width: 1440px) {
    .hero-title {
        font-size: var(--step-5);
    }
}

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {

    .section,
    .experience-section {
        padding: 5rem 2rem;
    }

    .navbar {
        padding: 1.5rem 2rem;
    }

    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .case-details-grid {
        gap: 2rem !important;
    }

    .about-content-grid {
        gap: 3rem;
    }

    .social-links {
        gap: 1rem;
    }

    .hero-title {
        font-size: var(--step-4);
    }

    .marquee-inner {
        font-size: var(--step-4);
    }

    .case-close {
        left: 2rem;
    }
    
    .pure-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {

    .nav-location,
    .nav-actions a {
        display: none !important;
    }

    .navbar {
        padding: 1.5rem;
    }

    .section,
    .experience-section,
    .pure-gallery-grid-section {
        padding: 3rem 1.25rem !important;
        overflow-x: hidden; /* Prevent horizontal scroll on sections */
    }

    /* Fix hero blowout on mobile */
    .hero {
        min-height: 55vh; /* Much shorter on mobile so it doesn't crop horribly */
        padding-top: 15vh;
        padding-bottom: 3rem;
        background-position: center center;
    }

    .section-title {
        font-size: var(--step-2);
        margin-bottom: 2.5rem;
    }

    .hero-title {
        font-size: 13vw; /* Slightly adjusted to ensure long words like SELECTED fit perfectly */
    }

    .cards-deck-container {
        height: 250px; /* Smaller deck on mobile */
    }

    .works-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .work-item:nth-child(even) {
        margin-top: 0;
    }

    .hero-sub {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .cursor,
    .cursor-follower {
        display: none !important;
    }

    body {
        cursor: auto;
    }

    .about-content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image {
        aspect-ratio: 1/1; /* Better image aspect ratio on mobile */
        margin-bottom: 1rem;
    }

    /* Fix iOS Safari touch delay and click issues */
    .menu-btn, .menu-close-btn, .case-trigger, .case-close, .magnetic {
        cursor: pointer !important;
        touch-action: manipulation;
    }

    /* Keep dock items nicely spaced on very narrow phones */
    .dock {
        padding: 0 1rem 0.6rem 1rem;
        gap: 0.5rem;
    }
    
    .dock-item {
        width: 32px; 
        height: 32px;
    }

    .experience-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 2rem 0;
    }

    .case-modal-content {
        padding: 0 1rem;
    }

    .case-title {
        font-size: var(--step-2) !important;
    }

    .case-details-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        margin-bottom: 3rem !important;
        padding-top: 2rem !important;
    }

    .case-close {
        top: 3.5rem;
        left: 1.5rem;
        font-size: var(--step--1);
    }

    .big-link {
        font-size: var(--step-2);
        word-break: break-word;
        line-height: 1.4;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .menu-links a {
        font-size: var(--step-4);
    }
}

/* Pure Gallery Page Grid */
.gallery-page-hero {
    min-height: 40vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 15vh;
}

.pure-gallery-grid-section {
    padding: 0 0 10rem; /* edge to edge */
    overflow: hidden;
}

.pure-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-gap: 0;
    max-width: 100%;
    margin: 0;
}

.gallery-item {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    cursor: none;
    aspect-ratio: 16/9;
}

.gallery-item[style*="grid-column: span 2"] {
    aspect-ratio: auto; /* let it stretch naturally based on width without gap */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 3rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item-title {
    font-size: var(--step-1);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.gallery-item-category {
    font-size: var(--step--1);
    color: var(--accent-color);
    font-weight: 500;
}

@media (max-width: 768px) {
    .pure-gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-item[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
        aspect-ratio: 4/3;
    }
    .pure-gallery-grid-section {
        padding: 0 2rem 5rem;
    }
}

/* macOS Style Dock */
.dock-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.dock {
    display: inline-flex;
    gap: 0.8rem;
    padding: 0 1.5rem 0.6rem 1.5rem; 
    background: rgba(190, 150, 255, 0.35); /* Light purple glass */
    border: 1px solid rgba(190, 150, 255, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    align-items: flex-end;
    height: 55px; /* Tighter height for smaller icons */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.dock-item {
    width: 40px; /* Reduced base size */
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    transform-origin: bottom center;
    will-change: width, height, transform;
    filter: drop-shadow(0 8px 15px rgba(0,0,0,0.4));
}

.dock-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: bottom center;
    will-change: transform;
}

/* --- High Performance Directives --- */
.cursor, .cursor-follower, .marquee-inner, .skills-marquee-inner, .cards-deck-container, .case-trigger {
    will-change: transform;
}

/* --- Premium Refinements --- */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

.page-transition {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background-color: var(--bg-color, #0f0f0f);
    z-index: 999999;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.76, 0, 0.24, 1);
    opacity: 1; /* Start dark! */
}

body.loaded .page-transition {
    opacity: 0;
}

body.exiting .page-transition {
    opacity: 1;
    pointer-events: all;
}

.scroll-progress-bar {
    position: fixed;
    top: 0; left: 0; height: 2px;
    background: linear-gradient(90deg, #b08dff, #BE96FF);
    z-index: 10000;
    width: 0%;
    transform-origin: left;
    will-change: width;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 60px;
    height: 60px;
    background: rgba(40, 40, 40, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-color, #BE96FF);
    font-size: 1.5rem;
    font-family: Arial, sans-serif;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, background 0.3s;
    cursor: pointer;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
    }
}