/* Intro animation container */
.intro-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--white-100);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    perspective: 1500px;
    pointer-events: none;
    transition: background-color 0.25s ease;
}

/* Permetti interazione con le card durante l'animazione */
.intro-container .scene {
    pointer-events: all;
}

/* Mantieni lo work visibile dopo l'animazione */
.intro-animation-complete .intro-container {
    background-color: transparent;
    z-index: 11;
    /* Mantieni sopra la homepage, sotto la case-modal (z-index: 12) */
}

.scene {
    width: 268px;
    height: calc(268px * 3 / 5);
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateZ(-10deg);
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.card {
    position: absolute;
    width: 100%;
    height: 100%;
    aspect-ratio: 5 / 3;
    left: 0;
    top: 0;
    background: white;
    color: white;

    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: 400;
    backface-visibility: visible;
    opacity: 1;
    border: 10px solid white;
    transform-origin: center center;
    /*box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;*/
    box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;

}

@media (max-width: 640px) {
    .card {
        border-width: 5px;
        border-radius: 3px;
    }
}

.card span {
    font-size: 1rem;
    font-weight: normal;
    opacity: 0.7;
    margin-top: 10px;
}

/* Loader */
.loader-container {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

.loader-counter {
    font-family: "Figtree", sans-serif;
    font-size: 1.5rem;
    /* Large size as requested for title-like appearance */
    font-weight: 400;
    color: var(--black-100);
    /* Assuming dark text on light background */
    line-height: 1;
    font-variant-numeric: tabular-nums;
    /* Prevents jitter when numbers change */
}

/* Hide main content initially */
.site-shell {
    opacity: 1;
}

.floating-video,
.floating-star,
.floating-star-message {
    opacity: 0;
    /* Shown via GSAP after intro */
}

/* Floating video is deprecated: hide completely */
.floating-video {
    display: none !important;
}

.mobile-footer {
    opacity: 0;
}

/* ===== Responsive wrappers (Desktop vs Mobile placeholder) ===== */



.mobile {
    display: none;
}

.mobile-placeholder {
    display: none;
}

.mobile-placeholder__trigger.case-trigger {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--black-100);
    background: var(--white-100);
    color: var(--black-100);
    border-radius: 999px;
    padding: 16px 20px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 1.125rem;
    line-height: 1.1;
}

@media (max-width: 640px) {

    /* Mobile: show full desktop shell with responsive layout (handled by mobile.css) */
    .mobile {
        display: none !important;
    }

    .mobile-placeholder {
        display: none !important;
    }
}

/* Nascondi gli elementi della lista inizialmente */
.case-item {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
}

/* ===== WORK GRID (post-intro) ===== */

:root {
    --work-card-width: clamp(134px, 15.2vw, 246px);
    --work-card-height: calc(var(--work-card-width) * 3 / 5);
    --work-gap: clamp(18px, 3vw, 56px);
}

.intro-container .work-grid {
    pointer-events: none;
}

.work-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(2, var(--work-card-width));
    justify-content: center;
    align-content: center;
    justify-items: center;
    align-items: start;
    column-gap: var(--work-gap);
    row-gap: clamp(18px, 3vw, 44px);
    padding: clamp(24px, 6vw, 96px);
    z-index: 2;
    pointer-events: none;
}

.work-group {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    cursor: pointer;
    text-align: center;
    transform: translateZ(0);
    transition: opacity .35s cubic-bezier(0.22, 1, 0.36, 1),
        background-color .35s cubic-bezier(0.22, 1, 0.36, 1),
        transform .35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
}

.work-group:focus-visible {
    outline: 2px solid var(--black-100);
    outline-offset: 6px;
    border-radius: 12px;
}

.work-cards {
    position: relative;
    width: var(--work-card-width);
    height: var(--work-card-height);
    transform-style: preserve-3d;
}

/* Override the big list typography inside the works grid */
.work-grid .case-trigger {
    font-size: clamp(13px, 1.05vw, 17px);
    margin: 0;
    line-height: 1.28;
    word-spacing: 0.08em;
    letter-spacing: 0.01em;
    transform: none;
    transform-origin: center;
    text-align: center;
    max-width: clamp(200px, 22vw, 320px);
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Hide work titles under cards in Selected Work */
.work-grid .work-title {
    display: none !important;
}

.work-grid.is-hovering .work-group.is-active {
    opacity: 1;
    z-index: 9998;
}

.work-grid.is-hovering .work-group:not(.is-active) {
    opacity: 0.34;
}

/* When modal is open, hide works overlay to avoid covering the dialog */
body.page-home--modal-open .work-grid {
    pointer-events: none;
}

body.work-grid-ready .case-list {
    display: none;
}

/* Hide works completely when About is active */
@media (max-width: 768px) {
    :root {
        --work-card-width: clamp(116px, 28.8vw, 210px);
        --work-gap: clamp(14px, 3vw, 28px);
    }

    .work-grid {
        grid-template-columns: repeat(2, minmax(0, var(--work-card-width)));
        row-gap: clamp(14px, 2.8vw, 24px);
        column-gap: clamp(12px, 3vw, 20px);
    }
}

/* ===== PLAYGROUND MODE ===== */

.playground-container {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* World wrapper for edge-pan camera */
.playground-world {
    position: absolute;
    inset: 0;
    will-change: transform;
}

/* When Playground is active, hide the ordered work UI */
body.view-playground .work-grid {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.view-playground .playground-container {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.view-playground:not(.view-about) .playground-container {
    cursor: default;
    touch-action: auto;
}

body.page-home--modal-open .playground-container {
    pointer-events: none;
}

body.view-transitioning .footer-btn--tabs {
    pointer-events: none;
}

/* While changing views, disable work hover handlers that can mutate z-index mid-transition */
body.view-transitioning .work-grid,
body.view-transitioning .work-grid .work-group {
    pointer-events: none !important;
}

.playground-container .card--playground {
    cursor: pointer;
    will-change: transform;
    touch-action: manipulation;
}

.playground-container .card--playground:focus-visible {
    outline: 2px solid var(--black-100);
    outline-offset: 6px;
    border-radius: 12px;
}

/* Playground cards */
body.view-playground .card--playground {
    background-size: cover !important;
    background-position: center;
    background-repeat: no-repeat;
}

/* Tooltip for About CTA */
.playground-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    pointer-events: none;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--new-grey, #BCB8AE);
    border-radius: 999px;
    color: var(--black-100);
    font-family: "Figtree", sans-serif;
    font-size: 0.95rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 0, 0);
}

/* Playground tuning panel */
.playground-tuning__toggle,
.playground-tuning {
    position: fixed;
    z-index: 10020;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s, transform 0.2s ease;
    font-family: "Figtree", sans-serif;
}

.playground-tuning__toggle {
    right: clamp(12px, 2vw, 24px);
    top: clamp(72px, 9vh, 96px);
    border: 1px solid rgba(188, 184, 174, 0.85);
    background: rgba(255, 255, 255, 0.98);
    color: var(--black-100);
    border-radius: 999px;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 12px;
    cursor: pointer;
    transform: translateY(-4px);
}

.playground-tuning {
    right: clamp(12px, 2vw, 24px);
    top: clamp(112px, 12vh, 138px);
    width: min(320px, calc(100vw - 24px));
    max-height: min(72vh, 620px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 14px;
    border: 1px solid rgba(188, 184, 174, 0.85);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 44px rgba(0, 0, 0, 0.12);
    transform: translateY(-6px);
    overflow: hidden;
}

.playground-tuning__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 0;
}

.playground-tuning__hint {
    margin: 0;
    padding: 0 14px;
    font-size: 0.72rem;
    line-height: 1.3;
    color: rgba(17, 17, 17, 0.62);
}

.playground-tuning__title {
    margin: 0;
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--black-100);
}

.playground-tuning__body {
    overflow: auto;
    padding: 0 14px 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playground-tuning__row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.playground-tuning__row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.playground-tuning__label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(17, 17, 17, 0.8);
}

.playground-tuning__value {
    font-size: 0.73rem;
    color: rgba(17, 17, 17, 0.64);
    font-variant-numeric: tabular-nums;
}

.playground-tuning__number {
    width: 58px;
    height: 24px;
    border: 1px solid rgba(188, 184, 174, 0.85);
    border-radius: 6px;
    background: #fff;
    color: var(--black-100);
    font-size: 0.72rem;
    text-align: right;
    padding: 2px 6px;
}

.playground-tuning__slider {
    width: 100%;
    accent-color: #191919;
}

.playground-tuning__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 14px 12px;
}

.playground-tuning__action {
    border: 1px solid rgba(188, 184, 174, 0.85);
    border-radius: 999px;
    background: #fff;
    color: var(--black-100);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 7px 11px;
    cursor: pointer;
}

body.view-playground .playground-tuning__toggle,
body.view-playground .playground-tuning {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.2s ease, visibility 0s linear 0s, transform 0.2s ease;
}

body.view-playground .playground-tuning {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.view-playground.playground-tuning-open .playground-tuning {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

body.view-playground.playground-tuning-open .playground-tuning__toggle {
    transform: translateY(0);
}

@media (max-width: 640px) {

    .playground-tuning__toggle,
    .playground-tuning {
        display: none;
    }
}

body.page-home--modal-open .playground-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;
}

body.page-home--modal-open .playground-tuning__toggle,
body.page-home--modal-open .playground-tuning {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Dimmed cards in playground mode when hovering */
/* Note: !important needed to override Style.css ".card { opacity: 1 !important }" */
.playground-container.is-hovering .card--playground {
    transition: opacity 0.25s ease-out;
}

.playground-container.is-hovering .card--playground.is-active {
    opacity: 1 !important;
    z-index: 9998;
}

/* ABOUT VIEW SPECIFIC STYLES */
.about-view-content,
.selected-work-view-content,
.playground-view-content {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(300px, clamp(300px, 44vw, 620px)) minmax(180px, 1fr);
    align-items: center;
    padding-inline: clamp(24px, 5vw, 96px);
    opacity: 0;
    visibility: hidden;
    filter: blur(2px);
    will-change: opacity, transform, filter;
    transition:
        opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0.28s;
    z-index: 12;
    pointer-events: none;
}

.about-view-content {
    transform: translateY(-12px);
}

.selected-work-view-content {
    transform: translateY(12px);
}

.playground-view-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transform: translateY(12px);
}

.playground-view-copy {
    max-width: min(62ch, 68vw);
    padding-inline: clamp(20px, 4vw, 40px);
}

.playground-view-copy .about-view-title {
    margin-bottom: 14px;
}

.playground-view-copy .about-view-description {
    margin-inline: auto;
    text-wrap: balance;
    max-width: min(54ch, 72vw);
}

body.view-about .about-view-content {
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    transform: translateY(0);
    transition-delay: 0s, 0s, 0s, 0s;
}

body.view-about .about-view-side {
    pointer-events: auto;
}

body.view-about .about-social-links {
    pointer-events: auto;
    z-index: 100;
}

body.work-grid-ready:not(.view-about):not(.view-playground) .selected-work-view-content {
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    transform: translateY(0);
    transition-delay: 0s, 0s, 0s, 0s;
}

body.view-playground:not(.view-about) .playground-view-content {
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    transform: translateY(0);
    transition-delay: 0s, 0s, 0s, 0s;
}

body.page-home--modal-open .selected-work-view-content {
    opacity: 0 !important;
    visibility: hidden !important;
}

body.page-home--modal-open .playground-view-content {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* During section transitions, avoid flashing Work side copy only outside Work view. */
body.view-transitioning.view-playground .selected-work-view-content,
body.view-transitioning.view-about .selected-work-view-content {
    opacity: 0 !important;
    visibility: hidden !important;
}

body.view-transitioning .playground-view-content {
    opacity: 0 !important;
    visibility: hidden !important;
}

<<<<<<< ours
<<<<<<< ours
=======
/* Keep a stable text layer while cards collapse back to Work. */
body.view-transitioning[data-transition-target="work"] .selected-work-view-content {
    opacity: 1 !important;
    visibility: visible !important;
    filter: blur(0) !important;
    transform: translateY(0) !important;
}

body.view-transitioning[data-transition-target="work"] .about-view-content,
body.view-transitioning[data-transition-target="work"] .playground-view-content {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

<<<<<<< ours
>>>>>>> theirs
=======
>>>>>>> theirs
=======
>>>>>>> theirs
.about-view-side {
    max-width: min(34ch, 30vw);
}

.about-view-side--left {
    grid-column: 1;
    justify-self: start;
}

.about-view-side--right {
    grid-column: 3;
    justify-self: end;
}

.about-view-title {
    font-family: "Figtree", sans-serif;
    font-size: clamp(1.8rem, 3.2vw, 3.1rem);
    margin: 0;
    color: var(--black-100);
    line-height: 1.04;
    text-wrap: balance;
}

.about-social-links {
    display: flex;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.about-social-links .social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--black-100);
    text-decoration: none;
    font-size: clamp(0.875rem, 1vw, 1rem);
    transition: color 0.25s ease;
}

.about-social-links .social-link:hover {
    color: var(--cream-dark, #8B8579);
}

.about-social-links .social-link:hover .social-link-arrow {
    transform: translate(2px, -2px);
}

.about-social-links .social-link .social-link-arrow {
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
    transition: transform 0.25s ease;
}

.about-view-description {
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    color: var(--black-100);
    opacity: 0.84;
    margin: 0;
    line-height: 1.58;
}

@media (max-width: 1120px) {

    .about-view-content,
    .selected-work-view-content,
    .playground-view-content {
        grid-template-columns: 1fr;
        align-content: start;
        gap: 16px;
        padding-inline: clamp(20px, 6vw, 40px);
        padding-top: clamp(60px, 9vh, 100px);
    }

    .playground-view-content {
        display: flex;
        align-items: center;
        justify-content: center;
        padding-top: 0;
    }

    .about-view-side {
        max-width: 64ch;
    }

    .about-view-side--left,
    .about-view-side--right {
        grid-column: 1;
        justify-self: center;
        text-align: center;
    }

    .about-social-links {
        justify-content: center;
    }
}

/* About mode: cards are non-interactive (no click/hover/pointer handlers). */
body.view-about .playground-container .card {
    pointer-events: none !important;
}

/* Scroll container hint for About mode */
body.view-about .playground-container {
    cursor: grab;
}

body.view-about .playground-container:active {
    cursor: grabbing;
}
