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

:root {
    --wall: #f2f0eb;
    --ceiling: #fdfdfc;
    --shadow: rgba(0, 0, 0, 0.08);
    --ink: #23201c;
    --accent: #d2232a;
    --frame: #dcd6cf;
    --cta-border: #1f1a16;
}

body.gallery-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #cccccc;
    color: var(--ink);
    overflow: hidden;
    min-height: 100vh;
}

.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    background: #cccccc;
}

.gallery-menu-toggle {
    position: fixed;
    top: 1.2rem;
    right: 1.6rem;
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 12px;
    background: transparent;
    display: grid;
    place-items: center;
    gap: 4px;
    z-index: 12;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
}

.gallery-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #ffffff;
    border-radius: 999px;
}

.gallery-menu-toggle:hover,
.gallery-menu-toggle:focus-visible {
    background: rgba(255,255,255,0.1);
    border-color: #ffffff;
}

.gallery-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(320px, 80vw);
    background: #ffffff;
    box-shadow: -12px 0 30px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 260ms ease;
    z-index: 11;
    padding: 1.2rem 1.2rem 2rem;
    display: grid;
    gap: 1rem;
}

.gallery-menu.open {
    transform: translateX(0);
}

.gallery-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
}

.gallery-menu-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid rgba(0,0,0,0.15);
    background: #ffffff;
    cursor: pointer;
    position: relative;
    font-size: 0;
    display: grid;
    place-items: center;
    transform: rotate(-6deg);
}

.gallery-menu-close::before,
.gallery-menu-close::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background: #222;
    border-radius: 999px;
}

.gallery-menu-close::before {
    transform: rotate(45deg);
}

.gallery-menu-close::after {
    transform: rotate(-45deg);
}

.gallery-menu-list {
    display: grid;
    gap: 0.5rem;
    max-height: calc(100vh - 120px);
    overflow: auto;
    padding-right: 0.4rem;
}

.gallery-menu-item {
    text-align: left;
    background: #f4f1ea;
    border: none;
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    font-weight: 600;
}

body.intro-done .intro-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease;
}

.intro-stage {
    width: 100%;
    height: 100%;
    position: relative;
    display: grid;
    place-items: center;
}

.intro-writing {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 2;
}

.intro-text {
    position: relative;
    font-size: clamp(56px, 12vw, 140px);
    letter-spacing: 0.08em;
    font-weight: 900;
    color: #000000;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 1;
    text-shadow: none;
    z-index: 3;
}

.intro-text::after {
    content: none;
}

.intro-text::before {
    content: none;
}

.intro-spray {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transform: none;
    filter: none;
    z-index: 1;
}

.intro-start {
    position: relative;
    z-index: 3;
    margin-top: clamp(180px, 28vh, 260px);
    padding: 0.7rem 1.6rem;
    border-radius: 999px;
    border: none;
    background: #0b3a6a;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

@keyframes sprayReveal {
    0% {
        clip-path: inset(0 100% 0 0);
        opacity: 0;
        filter: blur(2.4px);
    }
    10% {
        opacity: 1;
    }
    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
        filter: blur(0.2px);
    }
}

@keyframes canWrite {
    0% { transform: translateX(-40px) translateY(10px) rotate(-12deg); }
    16.66% { transform: translateX(35px) translateY(6px) rotate(-11deg); }
    33.33% { transform: translateX(110px) translateY(10px) rotate(-10deg); }
    50% { transform: translateX(190px) translateY(6px) rotate(-9deg); }
    66.66% { transform: translateX(270px) translateY(10px) rotate(-8deg); }
    83.33% { transform: translateX(350px) translateY(6px) rotate(-7deg); }
    100% { transform: translateX(430px) translateY(10px) rotate(-6deg); }
}

@keyframes canExit {
    from { transform: translateX(430px) translateY(10px) rotate(-6deg); }
    to { transform: translateX(calc(100% + 160px)) translateY(-22px) rotate(-2deg); }
}

body.gallery-body::before {
    content: '';
    position: fixed;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, 60vw);
    height: 4px;
    background: #ffffff;
    border-radius: 999px;
    z-index: 6;
    pointer-events: none;
    box-shadow: 0 0 22px rgba(255,255,255,0.98), 0 0 80px rgba(255,255,255,0.8);
}

.gallery-main::before {
    content: '';
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, 60vw);
    height: 6px;
    background: #000;
    border-radius: 999px;
    z-index: 6;
    pointer-events: none;
}

.gallery-main::after {
    content: '';
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(min(520px, 60vw) + 12px);
    height: 20px;
    background: #000000;
    border-radius: 4px;
    z-index: 5;
    pointer-events: none;
    box-shadow: inset 0 -2px 0 rgba(255,255,255,0.12);
}

body.gallery-body::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    width: min(820px, 86vw);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(closest-side at 50% 10%,
            rgba(255,255,255,0.95),
            rgba(255,255,255,0.55) 55%,
            rgba(255,255,255,0) 100%
        ),
        linear-gradient(90deg,
            rgba(255,255,255,0) 0%,
            rgba(255,255,255,0.22) 14%,
            rgba(255,255,255,0.9) 50%,
            rgba(255,255,255,0.22) 86%,
            rgba(255,255,255,0) 100%
        );
    mix-blend-mode: screen;
    filter: blur(2px);
}

.gallery-main,
.gallery-nav,
.scroll-arrow {
    position: relative;
    z-index: 2;
}

.gallery-main {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.gallery-ceiling {
    height: 140px;
    background: linear-gradient(180deg, var(--ceiling), rgba(255,255,255,0));
    display: flex;
    gap: 4rem;
    padding: 0 6vw;
}

.gallery-ceiling span {
    flex: 1;
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.9), rgba(255,255,255,0.1) 65%);
    clip-path: polygon(15% 0, 85% 0, 100% 100%, 0% 100%);
    opacity: 0.7;
}

.gallery-wall {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    scrollbar-width: none;
    position: relative;
    background: transparent;
}

.gallery-wall::-webkit-scrollbar {
    display: none;
}

.gallery-track {
    display: flex;
    gap: 0;
    padding: 0;
    align-items: center;
    height: 100%;
    position: relative;
}

.gallery-track::after {
    content: '';
    flex: 0 0 120vw;
}

.gallery-panel {
    flex: 0 0 100vw;
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 3rem 0 1rem;
}

.candidate-photo-panel {
    flex-direction: column;
    justify-content: center;
    gap: 1.6rem;
}

.candidate-stage {
    position: relative;
    width: min(360px, 52vw);
    height: min(520px, 68vh);
    display: grid;
    place-items: center;
}

.photo-frame {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translate(-50%, -50%) translateZ(0);
    width: 100%;
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 1;
    transition: opacity 260ms ease;
}

.photo-frame img {
    border-radius: 0;
    box-shadow: none;
    position: relative;
    z-index: 2;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.candidate-photo-panel .photo-frame,
.candidate-photo-panel .candidate-cta {
    box-shadow: none;
}

.candidate-photo-panel .candidate-cta {
    border-color: transparent;
}

.candidate-photo-panel .photo-frame {
    background: #f7f7f5;
    border-radius: 18px;
    padding: 18px;
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.9),
        inset 0 -8px 16px rgba(0,0,0,0.08),
        0 26px 50px rgba(0,0,0,0.18),
        0 6px 16px rgba(0,0,0,0.12);
}

.candidate-photo-panel .photo-frame::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.08);
    pointer-events: none;
}

.photo-frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}


.candidate-cta {
    width: min(420px, 70vw);
    text-decoration: none;
    background: #ececec;
    padding: 1.15rem 2.2rem;
}

.candidate-tile.candidate-cta {
    background: #ececec;
    position: relative;
    z-index: 3;
    border: 1px solid rgba(0,0,0,0.8);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.55),
        inset 0 0 0 1px rgba(255,255,255,0.38),
        inset 0 1px 0 rgba(255,255,255,0.55),
        inset 0 -1px 0 rgba(0,0,0,0.08);
    border-radius: 18px;
    overflow: hidden;
}

.candidate-cta-label {
    display: inline-block;
    font-size: 1.35rem;
    font-style: italic;
    letter-spacing: 0.01em;
    transition: transform 220ms ease;
}

.candidate-tile.candidate-cta:hover .candidate-cta-label,
.candidate-tile.candidate-cta:focus-visible .candidate-cta-label {
    animation: ctaSlide 700ms ease;
}

@keyframes ctaSlide {
    0% { transform: translateX(0); }
    45% { transform: translateX(14px); }
    100% { transform: translateX(0); }
}

.graffiti-slot {
    flex: 0 0 42vw;
    min-width: 280px;
    height: 100%;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0.7;
    transform: translateY(-2vh);
}

.graffiti-image {
    width: min(520px, 36vw);
    max-width: 100%;
    height: auto;
    filter: contrast(1.05);
}

.candidate-photo-panel .candidate-details {
    width: 100%;
    color: #444444;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%) translateY(6px);
    padding: 1.1rem 1.2rem;
    z-index: 2;
    transition: opacity 280ms ease, transform 280ms ease;
}

.candidate-meta {
    margin-top: 1.2rem;
    display: grid;
    gap: 1.1rem;
}

.candidate-section-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.candidate-section-title svg {
    width: 18px;
    height: 18px;
    display: block;
}

.candidate-section-title.theme-blue {
    color: #0047AB;
}

.candidate-section-title.theme-red {
    color: #D2232A;
}

.candidate-section-title.theme-grey {
    color: #444444;
}

.candidate-section-body {
    margin-top: 0.45rem;
    line-height: 1.65;
    color: #444444;
    font-size: 1.02rem;
}

.candidate-section-list {
    margin: 0.55rem 0 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.45rem;
    color: #444444;
    font-size: 1.02rem;
    line-height: 1.55;
}

.candidate-photo-panel.is-details .candidate-details {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) translateY(0);
}

.candidate-photo-panel .candidate-details p {
    margin-bottom: 1rem;
    max-width: none;
}

@media (max-width: 768px) {
    .candidate-stage {
        width: min(420px, 90vw);
        height: min(620px, 76vh);
    }

    .candidate-photo-panel .candidate-details {
        padding: 0.9rem 0.9rem;
    }
}

.candidate-photo-panel .candidate-details ul {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.6rem;
}

.candidate-back {
    margin-top: 1.2rem;
    border: none;
    background: transparent;
    color: #000;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.candidate-photo-panel.is-details .photo-frame {
    opacity: 0;
    pointer-events: none;
}

.candidate-photo-panel .candidate-cta {
    transition: opacity 260ms ease, transform 260ms ease;
}

.candidate-photo-panel.is-details .candidate-cta {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
}

.gallery-panel:nth-of-type(1) {
    align-items: center;
}

.panel-text {
    width: min(520px, calc(100vw - 20vw));
    max-width: 72ch;
}

.gallery-panel:nth-of-type(1) .panel-text {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 3rem 3.5rem 4rem;
    z-index: 1;
}

.gallery-panel:nth-of-type(1) .panel-text::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -18px;
    transform: translateX(-50%);
    width: 160%;
    height: 160px;
    z-index: -1;
    background: radial-gradient(closest-side at 50% 0%,
        rgba(255,255,255,0.9),
        rgba(255,255,255,0.55) 35%,
        rgba(255,255,255,0.18) 65%,
        rgba(255,255,255,0) 100%
    );
    filter: blur(10px);
    border-radius: 999px 999px 0 0;
}

.gallery-panel:not(.candidates-panel) {
    justify-content: flex-end;
}

.gallery-panel:not(.candidates-panel):nth-of-type(even) {
    justify-content: flex-start;
}

.gallery-panel:not(.candidates-panel) .panel-text {
    margin-right: 6vw;
}

.gallery-panel:not(.candidates-panel):nth-of-type(even) .panel-text {
    margin-right: 0;
    margin-left: 6vw;
}

.candidates-panel {
    align-items: center;
}

.gallery-panel.candidates-panel {
    flex-basis: 200vw;
    grid-template-columns: minmax(280px, 360px) 1fr;
}

.candidates-wall {
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.candidate-pages {
    display: flex;
    gap: 6rem;
    align-items: center;
}

.candidate-page {
    flex: 0 0 auto;
}

.candidate-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 280px;
    grid-template-rows: repeat(4, 74px);
    gap: 1.6rem;
    padding: 0.5rem;
}

.candidate-tile {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 1.05rem 1.6rem;
    border-radius: 22px;
    border: 1px solid rgba(0,0,0,0.18);
    background: var(--wall);
    font-weight: 650;
    letter-spacing: 0.01em;
    transition: border-color 0.16s ease;
}

.candidate-tile:hover {
    border-color: rgba(0,0,0,0.78);
}

.panel-kicker {
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--accent);
}

.panel-text h1,
.candidate-details h1 {
    font-size: 2.6rem;
    margin: 1rem 0;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.1);
    color: #000000;
    font-weight: 500;
}

.panel-text p,
.candidate-details p {
    font-size: 1.08rem;
    line-height: 1.7;
    color: #444444;
    max-width: 46ch;
}

.panel-actions {
    margin-top: 2rem;
}

.panel-actions .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 1.8rem;
    border-radius: 999px;
    border: 2px solid var(--cta-border);
    background: transparent;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
}

.panel-actions .cta-button:hover {
    transform: translateY(-2px);
    background: rgba(0,0,0,0.05);
}

.gallery-baseboard {
    height: 22px;
    background:
        repeating-linear-gradient(90deg,
            rgba(0,0,0,0) 0 79px,
            rgba(0,0,0,0.18) 79px 80px
        ),
        linear-gradient(180deg, #dcd5ca, #b4aca1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 -6px 18px rgba(0,0,0,0.2);
}

.gallery-floor {
    position: relative;
    height: 180px;
    --floor-shift: 0px;
    background: #f2f0eb;
    transform-origin: top;
    transform: perspective(900px) rotateX(58deg);
    overflow: hidden;
}

.gallery-floor::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 420%;
    background: #f2f0eb;
    background-size: cover;
    transform: translateX(calc(-50% + var(--floor-shift, 0px)));
    will-change: transform;
    transition: transform 0.08s ease-out;
}

.scroll-arrow {
    position: fixed;
    bottom: 4.6rem;
    top: auto;
    transform: none;
    width: 46px;
    height: 46px;
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
    z-index: 7;
    transition: opacity 280ms ease;
    border: none;
    border-radius: 14px;
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 22px rgba(0,0,0,0.22);
}

.scroll-arrow.visible {
    opacity: 1;
}

.scroll-arrow.right {
    right: max(4vw, 22px);
    background: #D2232A;
}

.scroll-arrow.left {
    left: max(4vw, 22px);
    background: #0047AB;
}

.scroll-arrow svg {
    width: 22px;
    height: 22px;
    display: block;
}

.mobile-controls {
    display: none;
}

.gallery-nav {
    position: fixed;
    left: 50%;
    bottom: 1.15rem;
    transform: translateX(-50%);
    height: 38px;
    z-index: 6;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.7rem;
    width: min(760px, calc(100vw - 12vw));
}

.gallery-progress {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: rgba(0,0,0,0.12);
    border-radius: 999px;
    overflow: hidden;
    z-index: 0;
}

.gallery-progress span {
    display: block;
    height: 100%;
    background: var(--accent);
    width: var(--progress, 0%);
}

.gallery-home {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.18);
    background: rgba(255,255,255,0.92);
    color: inherit;
    display: grid;
    place-items: center;
    text-decoration: none;
}

.gallery-home svg {
    width: 20px;
    height: 20px;
    display: block;
}

.gallery-steps {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    align-items: center;
}

.gallery-step {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.18);
    background: rgba(255,255,255,0.92);
    color: inherit;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.gallery-step.active {
    border-color: rgba(0,0,0,0.78);
}

.gallery-step svg {
    width: 16px;
    height: 16px;
    display: block;
}

.gallery-hint {
    position: fixed;
    bottom: 3.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.85);
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: opacity 0.3s, transform 0.3s;
}

.gallery-hint.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
}

@media (max-width: 1024px) {
    .gallery-panel {
        flex-basis: 100vw;
        padding: 2rem 6vw 1rem;
    }

    .candidate-grid {
        grid-auto-flow: row;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-columns: auto;
    }
}

@media (max-width: 768px) {
    body.gallery-body {
        overflow-y: auto;
    }

    .gallery-baseboard,
    .gallery-floor {
        display: none;
    }

    .gallery-wall {
        padding-bottom: 5rem;
    }

    .gallery-panel {
        flex-basis: 92vw;
        min-height: auto;
        border-radius: 22px;
        padding-top: 100px;
        padding-bottom: 2rem;
    }

    .gallery-hint,
    .gallery-nav {
        display: none;
    }

    .scroll-arrow {
        display: none;
    }

    .mobile-controls {
        position: fixed;
        left: 50%;
        bottom: 1.2rem;
        transform: translateX(-50%);
        z-index: 8;
        display: grid;
        grid-template-columns: 52px 56px 52px;
        gap: 1.2rem;
        align-items: center;
        pointer-events: auto;
    }

    .mobile-arrow,
    .mobile-home {
        width: 52px;
        height: 52px;
        border-radius: 16px;
        border: none;
        display: grid;
        place-items: center;
        box-shadow: 0 12px 26px rgba(0,0,0,0.2);
        text-decoration: none;
        color: #fff;
        cursor: pointer;
    }

    .mobile-arrow.left {
        background: #0047AB;
    }

    .mobile-arrow.right {
        background: #D2232A;
    }

    .mobile-home {
        background: rgba(0,0,0,0.85);
    }

    .mobile-controls svg {
        width: 24px;
        height: 24px;
        display: block;
    }
}

@media (max-width: 480px) {
    .candidate-stage {
        width: min(320px, 92vw);
        height: min(420px, 62vh);
    }
}
