/* =========================================
   ROBOGENIUS — GALLERY THREE
   FUTURE PLAYGROUND
========================================= */

.rg-gallery-three {
    position: relative;
    overflow: hidden;
    padding: var(--section-padding-y-large) var(--container-padding);
    background: var(--color-background);
}

.rg-gallery-three__container {
    width: 100%;
    max-width: var(--container-width-wide);
    margin-inline: auto;
}

/* Header */

.rg-gallery-three__header {
    position: relative;
    max-width: 850px;
    margin-bottom: 64px;
}

.rg-gallery-three__eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.rg-gallery-three__status {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--color-brand-green);
    box-shadow: 0 0 0 5px rgb(0 190 130 / 12%);
}

.rg-gallery-three__title {
    max-width: 800px;
    margin: 0;
    color: var(--color-text);
    font-size: clamp(2.6rem, 6.3vw, 5.8rem);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.rg-gallery-three__title span {
    color: var(--color-brand-blue);
}

.rg-gallery-three__description {
    max-width: 530px;
    margin: 26px 0 0;
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: var(--line-height-relaxed);
}

/* Experimental canvas */

.rg-gallery-three__canvas {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: 70px 180px 190px 170px 60px;
    gap: 14px;
    isolation: isolate;
}

.rg-gallery-three__coordinate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.rg-gallery-three__coordinate--top {
    grid-column: 1 / -1;
    grid-row: 1;
    border-bottom: 1px solid var(--color-border);
}

.rg-gallery-three__coordinate--bottom {
    grid-column: 1 / -1;
    grid-row: 5;
    border-top: 1px solid var(--color-border);
}

/* Photos */

.rg-gallery-three__photo {
    position: relative;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border: 3px solid var(--color-text);
    background: var(--color-surface);
}

.rg-gallery-three__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.rg-gallery-three__photo:hover img {
    transform: scale(1.045);
}

.rg-gallery-three__photo figcaption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    color: #fff;
    background: rgb(20 25 35 / 78%);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.rg-gallery-three__photo--main {
    z-index: 2;
    grid-column: 2 / 8;
    grid-row: 2 / 4;
    transform: rotate(-1deg);
}

.rg-gallery-three__photo--secondary {
    z-index: 1;
    grid-column: 9 / 13;
    grid-row: 1 / 3;
    transform: rotate(2deg);
}

.rg-gallery-three__photo--tertiary {
    z-index: 2;
    grid-column: 1 / 5;
    grid-row: 4;
    transform: rotate(1.5deg);
}

.rg-gallery-three__photo--detail {
    z-index: 2;
    grid-column: 9 / 13;
    grid-row: 4;
    transform: rotate(-1.5deg);
}

/* Side note */

.rg-gallery-three__side-note {
    grid-column: 1;
    grid-row: 2 / 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    padding: 12px 0;
    color: var(--color-background);
}

.rg-gallery-three__side-note-number {
    color: var(--color-brand-orange);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 800;
}

.rg-gallery-three__side-note-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.rg-gallery-three__side-note-line {
    width: 1px;
    height: 22px;
    background: var(--color-border);
}

/* Brutalist manifesto */

.rg-gallery-three__manifesto {
    position: relative;
    z-index: 3;
    grid-column: 5 / 9;
    grid-row: 3 / 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: 24px;
    color: #fff;
    background: var(--color-text);
    border: 3px solid var(--color-text);
    box-shadow: 8px 8px 0 var(--color-text);
    transform: rotate(-2deg);
}

.rg-gallery-three__manifesto-index,
.rg-gallery-three__manifesto-footer {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.rg-gallery-three__manifesto p {
    margin: 18px 0;
    font-size: clamp(2rem, 4vw, 3.7rem);
    font-weight: 950;
    line-height: 0.88;
    letter-spacing: -0.07em;
    color: white;
}

.rg-gallery-three__manifesto p span {
    color: var(--color-brand-blue);
}

.rg-gallery-three__manifesto-dot {
    color: var(--color-brand-orange) !important;
}

.rg-gallery-three__manifesto-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* Signal graphic */

.rg-gallery-three__signal {
    z-index: 1;
    grid-column: 8 / 10;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    align-content: center;
    justify-items: center;
    padding: 16px;
    background: var(--color-brand-green);
    border: 2px solid var(--color-text);
    transform: rotate(4deg);
}

.rg-gallery-three__signal span {
    width: 100%;
    aspect-ratio: 1;
    max-width: 14px;
    background: var(--color-text);
}

.rg-gallery-three__signal span:nth-child(2),
.rg-gallery-three__signal span:nth-child(4),
.rg-gallery-three__signal span:nth-child(8) {
    opacity: 0.2;
}

/* Decorative orbit */

.rg-gallery-three__orbit {
    position: absolute;
    z-index: 4;
    top: 30%;
    right: 27%;
    display: flex;
    gap: 8px;
    color: var(--color-brand-orange);
    font-size: 1.5rem;
    font-weight: 900;
    pointer-events: none;
}

.rg-gallery-three__orbit span:nth-child(2) {
    transform: translateY(-12px);
}

.rg-gallery-three__orbit span:nth-child(3) {
    transform: translateY(5px);
}

/* Footer */

.rg-gallery-three__footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

/* Tablet */

@media (max-width: 900px) {
    .rg-gallery-three__canvas {
        grid-template-rows: 60px 160px 170px 150px 55px;
        gap: 12px;
    }

    .rg-gallery-three__manifesto {
        padding: 18px;
    }

    .rg-gallery-three__manifesto p {
        font-size: clamp(1.8rem, 4vw, 2.8rem);
    }

    .rg-gallery-three__signal {
        padding: 10px;
    }

    .rg-gallery-three__photo figcaption {
        flex-wrap: wrap;
        font-size: 0.58rem;
    }
}

/* Mobile */

@media (max-width: 600px) {
    .rg-gallery-three {
        padding-block: var(--section-padding-y);
    }

    .rg-gallery-three__header {
        margin-bottom: 40px;
    }

    .rg-gallery-three__title {
        font-size: clamp(2.2rem, 9vw, 3.8rem);
    }

    .rg-gallery-three__description {
        font-size: 0.95rem;
    }

    .rg-gallery-three__canvas {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-template-rows: 45px 210px 125px 190px 145px 45px;
        gap: 10px;
    }

    .rg-gallery-three__coordinate {
        font-size: 0.55rem;
    }

    .rg-gallery-three__photo--main {
        grid-column: 1 / 7;
        grid-row: 2;
        transform: rotate(-1deg);
    }

    .rg-gallery-three__photo--secondary {
        grid-column: 4 / 7;
        grid-row: 3;
        transform: rotate(2deg);
    }

    .rg-gallery-three__side-note {
        grid-column: 1 / 4;
        grid-row: 3;
        flex-direction: row;
        justify-content: space-around;
        padding: 0 5px;
    }

    .rg-gallery-three__side-note-text {
        writing-mode: initial;
        transform: none;
        font-size: 0.55rem;
    }

    .rg-gallery-three__side-note-line {
        width: 12px;
        height: 1px;
    }

    .rg-gallery-three__manifesto {
        grid-column: 1 / 5;
        grid-row: 4;
        padding: 18px;
        transform: rotate(-1.5deg);
    }

    .rg-gallery-three__manifesto p {
        font-size: clamp(2rem, 9vw, 3rem);
    }

    .rg-gallery-three__signal {
        grid-column: 5 / 7;
        grid-row: 4;
        padding: 10px;
    }

    .rg-gallery-three__photo--tertiary {
        grid-column: 1 / 4;
        grid-row: 5;
        transform: rotate(1.5deg);
    }

    .rg-gallery-three__photo--detail {
        grid-column: 4 / 7;
        grid-row: 5;
        transform: rotate(-1.5deg);
    }

    .rg-gallery-three__orbit {
        display: none;
    }

    .rg-gallery-three__footer {
        flex-direction: column;
        gap: 10px;
        font-size: 0.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rg-gallery-three__photo img {
        transition: none;
    }
}
