:root {
    color-scheme: dark;
    --bg: #111217;
    --panel: #1a1b22;
    --line: #303139;
    --muted: #9a9ba5;
    --lime: #8080ff
}

* {
    box-sizing: border-box
}

[hidden] {
    display: none !important
}

body {
    margin: 0;
    background: var(--bg);
    color: #f5f4ed;
    font-family: "DM Sans", sans-serif
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 3px
}

.topbar {
    height: 86px;
    padding: 0 6%;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between
}

.brand {
    border: 0;
    background: none;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -1.6px;
    display: flex;
    align-items: center;
    gap: 11px
}

.brand-accent {
    color: var(--lime)
}

.brand-mark {
    font-size: 30px;
    color: var(--lime)
}

.top-right {
    display: flex;
    align-items: center;
    gap: 35px
}

.top-caption,
.eyebrow,
.selection-label,
footer,
.album-number,
.album-meta,
.art-label,
.legend,
.back-link,
.missing-badge,
.viewer-bottom,
.curtain-control,
.stage-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px
}

.top-caption {
    color: #777984
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid #44454c;
    border-radius: 50%;
    background: transparent;
    font-size: 22px
}

.icon-button:hover {
    border-color: var(--lime);
    color: var(--lime)
}

.icon-button:disabled {
    opacity: .5
}

main {
    max-width: 1450px;
    margin: auto;
    padding: 0 6% 120px
}

.hero {
    min-height: 380px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    overflow: hidden
}

.eyebrow {
    color: var(--lime);
    margin: 0 0 23px
}

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--lime);
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: 1px
}

h1,
h2,
p {
    margin-top: 0
}

h1 {
    font-family: "DM Sans", Georgia, serif;
    font-weight: 400;
    font-size: clamp(54px, 7vw, 98px);
    line-height: .96;
    letter-spacing: -2px;
    margin-bottom: 23px
}

h1 em {
    font-weight: 400;
    color: var(--lime)
}

.intro {
    max-width: 450px;
    color: #a6a7af;
    font-size: 15px;
    line-height: 1.8
}

.hero-art {
    position: relative;
    width: 360px;
    height: 300px;
    flex-shrink: 0
}

.art-box {
    position: absolute;
    width: 170px;
    height: 205px;
    border: 1px solid #55575d;
    transform: rotate(-12deg);
    top: 40px;
    left: 62px;
    background: #1a1c20
}

.art-one:after {
    content: "";
    position: absolute;
    inset: 15px;
    border: 1px solid #383b3c
}

.art-two {
    left: 135px;
    top: 66px;
    transform: rotate(12deg);
    background: repeating-linear-gradient(135deg, #8080ff 0px, #8080ff 2px, #b6d665 2px, #b6d665 14px);
    border: 0;
    opacity: .85
}

.art-plus {
    position: absolute;
    right: 8px;
    top: 25px;
    color: var(--lime);
    font-size: 37px
}

.art-label {
    position: absolute;
    right: 0;
    bottom: 15px;
    color: #85878b;
    line-height: 1.6
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin: 55px 0 26px;
    gap: 20px
}

.section-heading .eyebrow {
    margin-bottom: 13px
}

.section-heading h2 {
    font-family: "DM Sans", Georgia, serif;
    font-weight: 400;
    font-size: 38px;
    letter-spacing: -.7px;
    margin: 0
}

.section-heading>p {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 5px
}

.count {
    font-family: "DM Sans", sans-serif;
    color: #777982;
    font-size: 11px;
    vertical-align: top;
    letter-spacing: 1px;
    margin-left: 8px
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px
}

.album-card {
    position: relative;
    min-height: 185px;
    text-align: left;
    background: #1b1c22;
    border: 1px solid #303139;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: border-color .2s, background .2s
}

.album-card:hover,
.album-card:focus-visible {
    border-color: #939e70;
    background: #20231f
}

.album-card.selected {
    border-color: var(--lime);
    background: #252b20
}

.album-number {
    color: #777a83
}

.album-name {
    font-family: "DM Sans", Georgia, serif;
    font-size: 28px;
    line-height: 1.1;
    overflow-wrap: anywhere;
    margin: auto 0 12px
}

.album-meta {
    color: #8f9198;
    font-size: 9px
}

.album-indicator {
    position: absolute;
    right: 22px;
    top: 19px;
    border: 1px solid #494a50;
    border-radius: 50%;
    height: 28px;
    width: 28px;
    display: grid;
    place-items: center;
    font-size: 12px
}

.selected .album-indicator {
    background: var(--lime);
    border-color: var(--lime);
    color: #111
}

.album-description {
    display: none;
    position: absolute;
    z-index: 5;
    left: 10px;
    right: 10px;
    top: calc(100% - 5px);
    background: #34372e;
    color: #f5f5ec;
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.55;
    white-space: pre-wrap;
    max-height: 220px;
    overflow: auto;
    box-shadow: 0 10px 24px #0007
}

.album-card:hover .album-description,
.album-card:focus-visible .album-description {
    display: block
}

.empty {
    border: 1px dashed #3b3c44;
    padding: 40px;
    color: var(--muted);
    font-size: 14px
}

.selection-bar {
    position: fixed;
    z-index: 10;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #7777eb;
    color: #161b11;
    min-width: min(620px, 90vw);
    padding: 12px 12px 12px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 10px 40px #0008
}

.selection-bar>div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0
}

.selection-label {
    font-size: 9px;
    color: #65734d
}

.selection-bar #selection-text {
    font-size: 13px;
    overflow-wrap: anywhere
}

.primary-button {
    background: #181b15;
    color: white;
    border: 0;
    padding: 16px 21px;
    white-space: nowrap;
    font-size: 13px
}

.primary-button span {
    margin-left: 25px;
    color: var(--lime)
}

footer {
    border-top: 1px solid var(--line);
    padding: 25px 6%;
    display: flex;
    justify-content: space-between;
    color: #696b74;
    font-size: 9px
}

.footer-star {
    color: var(--lime)
}

.back-link {
    margin-top: 40px;
    border: 0;
    background: none;
    padding: 0;
    color: #a7a9ac
}

.back-link:hover {
    color: var(--lime)
}

.gallery-heading {
    margin-top: 42px
}

.gallery-heading h1 {
    font-size: clamp(40px, 5vw, 68px);
    overflow-wrap: anywhere
}

.gallery-heading .intro {
    margin: 0
}

.legend {
    display: flex;
    gap: 20px;
    color: #a5a6ae;
    white-space: nowrap
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 7px
}

.legend-dot.red {
    background: #ee6a6e
}

.legend-dot.blue {
    background: #6f9eee
}

.gallery-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    margin-bottom: 24px;
    padding: 8px;
    border: 1px solid var(--line);
    background: var(--panel)
}

.gallery-filter button {
    min-width: 48px;
    padding: 9px 12px;
    border: 1px solid #44454c;
    background: transparent;
    color: var(--muted)
}

.gallery-filter button:hover,
.gallery-filter button[aria-pressed="true"] {
    border-color: var(--lime);
    color: #f5f4ed
}

.gallery-filter button[aria-pressed="true"] {
    background: #4949d4
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 27px 16px
}

.image-card {
    border: 0;
    background: none;
    text-align: left;
    padding: 0;
    min-width: 0
}

.image-frame {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    background: #24252c;
    overflow: hidden
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s
}

.image-card:hover img {
    transform: scale(1.05)
}

.image-frame.red:after,
.image-frame.blue:after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none
}

.image-frame.red:after {
    background: #e23c4b55
}

.image-frame.blue:after {
    background: #367ced55
}

.missing-badge {
    position: absolute;
    z-index: 1;
    left: 10px;
    top: 10px;
    background: #1a1b20dd;
    padding: 7px;
    font-size: 9px
}

.thumb-placeholder {
    color: #a7a8af;
    font-size: 12px;
    padding: 15px;
    text-align: center
}

.image-filename {
    display: block;
    padding: 11px 1px;
    color: #d4d4d1;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

#notice {
    margin: 20px 0 0;
    padding: 12px 15px;
    background: #293021;
    color: #a079db;
    font-size: 13px
}

#notice.error {
    background: #43282c;
    color: #ffc8cc
}

.viewing {
    overflow: hidden
}

.viewer {
    position: fixed;
    inset: 0;
    background: #101115;
    z-index: 20;
    display: flex;
    flex-direction: column
}

.viewer-bar {
    min-height: 76px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #303139
}

.viewer-close {
    background: none;
    border: 0;
    font-size: 25px;
    padding: 8px
}

.viewer-name {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    margin-right: auto
}

.viewer-name>span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px
}

.viewer-name small {
    font-size: 10px;
    color: #a3a4ab;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.mode-controls {
    display: flex;
    border: 1px solid #3b3c43;
    padding: 3px;
    white-space: nowrap
}

.mode-controls button,
.viewer-action {
    border: 0;
    background: none;
    padding: 9px 12px;
    color: #a7a8af;
    font-size: 12px
}

.mode-controls button.active {
    background: #8080ff;
    color: #161b11
}

.viewer-action {
    border: 1px solid #3b3c43;
    color: white
}

.stages {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 2px;
    background: #404047
}

.stage {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    background: #1b1c21;
    cursor: grab;
    touch-action: none
}

.stage:active {
    cursor: grabbing
}

.image-layer {
    position: absolute;
    inset: 0;
    overflow: hidden
}

.original {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    transform-origin: 0 0;
    user-select: none;
    pointer-events: none
}

.stage-label {
    position: absolute;
    top: 15px;
    background: #111b;
    padding: 8px;
    color: #ebebe6;
    pointer-events: none;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.left-label {
    left: 15px
}

.right-label {
    right: 15px
}

.missing-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #9698a1;
    font-size: 13px;
    white-space: nowrap
}

.curtain-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--lime);
    pointer-events: none
}

.curtain-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px;
    background: #1b1c21;
    color: #b1b2b8
}

.curtain-control input {
    width: min(420px, 60vw);
    accent-color: var(--lime)
}

.viewer-message {
    padding: 10px 20px;
    background: #47352d;
    color: #ffe1b5;
    font-size: 12px
}

.viewer-bottom {
    bottom: 0px;
    padding-bottom: 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 24px;
    color: #90929a;
    font-size: 9px
}

.viewer-bottom div {
    display: flex;
    align-items: center;
    gap: 16px
}

.viewer-bottom button {
    border: 1px solid #42434b;
    background: none;
    padding: 6px 12px
}

.viewer-bottom button:disabled {
    opacity: .3
}

@media(max-width:900px) {
    .album-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .image-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .hero-art {
        transform: scale(.8);
        transform-origin: right center;
        width: 260px
    }

    .top-caption {
        display: none
    }
}

@media(max-width:600px) {
    .topbar {
        height: 70px
    }

    main {
        padding-bottom: 100px
    }

    .hero {
        min-height: 300px
    }

    .hero {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center
    }

    .album-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .album-card {
        min-height: 150px;
        padding: 15px
    }

    .album-name {
        font-size: 23px
    }

    .album-indicator {
        right: 15px;
        top: 15px
    }

    .image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column
    }

    .gallery-heading h1 {
        font-size: 40px
    }

    .viewer-bar {
        padding: 8px;
        gap: 4px;
        flex-wrap: wrap
    }

    .viewer-name {
        max-width: 45%
    }

    .mode-controls {
        order: 5;
        width: 100%;
        justify-content: center
    }

    .viewer-action {
        padding: 8px
    }

    .viewer-bottom>span {
        display: none
    }

    footer {
        gap: 15px
    }
}

.image-layer.overlay {
    background: #1b1c21
}

.curtain-line {
    width: 24px;
    margin-left: -12px;
    background: transparent;
    pointer-events: none;
    touch-action: none
}

.curtain-line:after {
    content: "";
    position: absolute;
    left: 11px;
    width: 2px;
    height: 100%;
    background: var(--lime);
    pointer-events: none
}

.curtain-line:before {
    content: "↔";
    position: absolute;
    z-index: 1;
    top: 15px;
    left: 0;
    width: 24px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--lime);
    border-radius: 4px;
    background: #1b1c21;
    color: var(--lime);
    cursor: ew-resize;
    pointer-events: auto
}

.background-status {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap
}

.top-right {
    gap: 16px
}

.blend-images {
    position: absolute;
    inset: 0;
    isolation: isolate
}

.blend-images .image-layer {
    mix-blend-mode: plus-lighter
}

#blend-control {
    flex-wrap: wrap
}

#blend-wiggle[aria-pressed="true"] {
    background: #4949d4;
    color: #161b11
}

@media(max-width:600px) {
    .viewer-bar .background-status {
        order: 4;
        margin-left: auto;
        font-size: 10px
    }

    .top-right {
        gap: 8px
    }
}

.viewer-progress {
    padding: 10px 20px;
    background: #1b1c21
}

.viewer-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d4d5d9;
    font-size: 12px
}

.viewer-progress-row+.viewer-progress-row {
    margin-top: 8px
}

.viewer-progress-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.viewer-progress-row progress {
    width: min(300px, 40vw);
    margin-left: auto;
    accent-color: var(--lime)
}

.viewer-metadata {
    position: absolute;
    z-index: 2;
    top: 86px;
    right: 24px;
    max-width: calc(100% - 32px);
    background: #1b1c21;
    border: 1px solid #494a50;
    box-shadow: 0 6px 24px #0008
}

.viewer-metadata summary {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 12px;
    color: #f5f4ed
}

.viewer-metadata summary:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 3px
}

.metadata-content {
    display: flex;
    gap: 16px;
    width: min(760px, calc(100vw - 80px));
    max-height: 60vh;
    overflow: auto;
    padding: 0 14px 14px
}

.metadata-column {
    flex: 1;
    min-width: 0
}

.metadata-column h3 {
    margin: 8px 0 12px;
    color: var(--lime);
    font-size: 12px;
    overflow-wrap: anywhere
}

.metadata-column dl {
    margin: 0
}

.metadata-column dt {
    margin-top: 12px;
    color: var(--muted);
    font-size: 11px
}

.metadata-column dd {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere
}

.metadata-column p {
    font-size: 12px;
    color: var(--muted)
}

@media(max-width:600px) {
    .viewer-metadata {
        top: auto;
        bottom: 55px;
        right: 16px
    }

    .metadata-content {
        width: calc(100vw - 62px);
        flex-direction: column;
        max-height: 45vh
    }
}

.filmstrip {
    position: relative;
    display: flex;
    flex: none;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    padding: 10px 24px;
    background: #1b1c21;
    cursor: grab;
    user-select: none
}

.filmstrip.dragging,
.filmstrip.dragging button {
    cursor: grabbing
}

.filmstrip-card {
    flex: 0 0 76px;
    width: 76px;
    padding: 2px;
    border: 2px solid transparent;
    background: none
}

.filmstrip-card[aria-current="true"] {
    border-color: var(--lime)
}

.filmstrip-card .image-frame {
    width: 100%;
    pointer-events: none
}

.filmstrip-card .thumb-placeholder {
    font-size: 9px;
    padding: 3px
}

.filmstrip-card .missing-badge {
    left: 2px;
    top: 2px;
    padding: 3px;
    font-size: 8px;
    letter-spacing: 0
}

.stages-wrapper {
    position: relative;
    display: flex;
    flex: 1;
    min-height: 0
}

.filmstrip-toggle {
    position: absolute;
    z-index: 3;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 32px;
    border: 1px solid #42434b;
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: #1b1c21;
    color: #b1b2b8;
    font-size: 16px
}

.filmstrip-toggle:hover {
    color: var(--lime);
    border-color: var(--lime)
}

.viewer-bottom {
    position: absolute;
    z-index: 2;
    bottom: 32px;
    left: 0;
    right: 0;
    pointer-events: none
}

.viewer-bottom>span,
.viewer-bottom>div {
    background: #1b1c21dd
}

.viewer-bottom>span {
    padding: 8px
}

.viewer-bottom>div {
    margin-left: auto;
    gap: 8px;
    padding: 4px
}

.viewer-bottom button {
    pointer-events: auto
}