body {
    font-family: monospace;
    font-size: 14px;
    max-width: 1400px;
    margin: 20px auto 0;
    margin-top: 60px;
    padding: 1rem 6rem;
}

.layout {
    --c1: 22;
    --c2: 22;
    --c3: 22;
    --grid-gap: 16px;
    display: grid;
    grid-template-columns:
        calc(var(--c1) * 1%) calc(var(--c2) * 1%) calc(var(--c3) * 1%)
        1fr;
    grid-auto-rows: 40px;
    gap: var(--grid-gap);
    align-content: start;
    position: relative;
    min-height: 2400px;
}

.categories {
    display: contents;
}

.categories ul {
    display: contents;
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories li {
    display: contents;
}

.cat {
    all: unset;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    height: 40px;
    display: flex;
    align-items: center;
    grid-column: 1;
}

.cat.active {
    font-weight: 700;
}

.track {
    position: relative;
    height: 40px;
    align-self: center;
    grid-column: 2;
    overflow: visible;
}

.shelf {
    position: absolute;
    bottom: 0;
    left: calc(-1 * (var(--c1) / var(--c2)) * 100% - 16px);
    width: calc((var(--c1) / var(--c2)) * 100% + 16px + var(--pos, 50%) + 32px);
    height: 2px;
    background: #000;
    opacity: 0.25;
    pointer-events: none;
}

.dot {
    position: absolute;
    bottom: 2px;
    left: var(--pos, 50%);
    transform: translate(-50%, var(--fall, 0px));
    display: block;
    line-height: 0;
}

.dot svg {
    display: block;
}

.detail {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.project {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.project img {
    max-width: 160px;
    height: auto;
}

.project-text h3 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
}

.project-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    margin-left: -4px;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
}

.handle::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 3px;
    width: 2px;
    background: #000;
    opacity: 0.25;
}

.handle:hover::after {
    opacity: 1;
}

.handle[data-h="1"] {
    left: calc(var(--c1) * 1%);
}

.handle[data-h="2"] {
    left: calc((var(--c1) + var(--c2)) * 1% + var(--grid-gap));
}

.handle[data-h="3"] {
    left: calc(
        (var(--c1) + var(--c2) + var(--c3)) * 1% + var(--grid-gap) +
            var(--grid-gap)
    );
}

.detail {
    grid-column: 4;
    grid-row: 1;
    align-self: start;
}

.size-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: #fff;
    border-top: 2px solid rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
    font-family: inherit;
    font-size: 14px;
}

.size-bar .row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.size-bar label {
    width: 60px;
}

.size-bar input[type="range"] {
    flex: 1;
    max-width: 320px;
}

.size-bar .val {
    width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.size-bar .mode-btn {
    font-family: inherit;
    font-size: 14px;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.size-bar .mode-btn:hover {
    background: #eee;
}

.size-bar .mode-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

#tracks-list {
    display: inline-flex;
    gap: 6px;
}

.modal {
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: var(--modal-left, 0);
    width: var(--modal-width, 0);
    background: #fff;
    padding: 32px;
    z-index: 50;
}

.modal[hidden] {
    display: none;
}

.modal-content {
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 32px;
    right: 32px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    padding: 0;
}

.modal-content h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
}

.modal-content img {
    display: block;
    max-width: 100%;
    max-height: 280px;
    height: auto;
    object-fit: contain;
    margin: 0 auto 16px;
}

.modal-content p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px;
}

.project {
    cursor: pointer;
}
