.projects {
    background: #1b1d21;
    padding: 72px 48px 88px;
    border-top: 1px solid #303238;
}

.project-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
}

.project-category {
    border: 1px solid #303238;
    border-radius: 12px;
    background: #1b1d21;
}

.project-category-title {
    cursor: pointer;
    border-radius: inherit;
    margin: 0;
    padding: 18px 24px;
    color: #b9ceff;
}

.project-category-title:focus-visible {
    outline: 2px solid #b9ceff;
    outline-offset: 3px;
}

.project-item-title {
    position: relative;
    display: block;
    padding-inline-start: 1.125rem;
    color: #f4f4f5;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
}

.project-item-title::-webkit-details-marker {
    display: none;
}

.project-item-title::before {
    position: absolute;
    inset-block-start: 0.85em;
    inset-inline-start: 0;
    width: 0.38em;
    height: 0.38em;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    content: "";
    transform: translateY(-75%) rotate(-45deg);
}

.project-category-content[open] > .project-item-title::before {
    transform: translateY(-85%) rotate(45deg);
}

.project-item-title:is(:hover, :focus-visible)::before {
    color: var(--winter-ice, #b9ceff);
}

.project-item-title:focus-visible {
    outline: 2px solid var(--winter-ice, #b9ceff);
    outline-offset: 4px;
}

.project-category-content[open] > .project-item-title {
    margin-bottom: 6px;
}

.project-category-content {
    padding: 16px 24px;
    border-top: 1px solid #303238;
    color: #bfc2cb;
}

.project-category-content p {
    margin: 0;
}

.project-slideshow {
    position: relative;
    z-index: 3;
    margin-top: 16px;
}

.project-slideshow-frame {
    display: grid;
    aspect-ratio: 16 / 10;
    place-items: center;
    overflow: hidden;
    border: 1px solid #41627d;
    border-radius: 6px;
    background: #0a131e;
}

.project-slideshow-frame img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}

.project-slideshow-controls:not([hidden]) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.875rem;
}

.project-slideshow-controls button {
    width: 36px;
    height: 32px;
    border: 1px solid #41627d;
    border-radius: 4px;
    background: #142638;
    color: #f3f8ff;
    font: inherit;
    cursor: pointer;
}

.project-slideshow-controls button:is(:hover, :focus-visible) {
    border-color: #a8ddff;
    color: #a8ddff;
}

.project-slideshow-frame {
    position: relative;
    width: 100%;
    padding: 0;
    color: inherit;
    cursor: zoom-in;
}

.project-image-viewer {
    cursor: zoom-out;
    box-sizing: border-box;
    max-width: 95vw;
    max-height: 95vh;
    padding: 12px;
    border: 1px solid #41627d;
    border-radius: 8px;
    background: #0a131e;
}

.project-image-viewer::backdrop {
    background: #050a12d9;
}

.project-image-viewer img {
    display: block;
    max-width: 100%;
    max-height: calc(95vh - 66px);
    margin-inline: auto;
    object-fit: contain;
}

.project-slideshow-dots {
    display: flex;
    gap: 2px;
}

.project-slideshow-dots button {
    display: grid;
    width: 28px;
    height: 28px;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
}

.project-slideshow-dots button::after {
    width: 8px;
    height: 8px;
    border: 1px solid #a8ddff;
    border-radius: 50%;
    content: "";
}

.project-slideshow-dots button[aria-pressed="true"]::after {
    background: #a8ddff;
}

.project-image-viewer .project-slideshow-controls {
    cursor: default;
}

.project-with-gallery {
    padding-block: 22px 26px;
}

.project-category-title,
.project-with-gallery > .project-item-title {
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.project-with-gallery[open] > .project-item-title {
    margin-bottom: 12px;
}

.project-item-title .project-subtitle {
    display: block;
    margin-top: 8px;
    letter-spacing: normal;
    color: var(--winter-ice, #b9ceff);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.45;
}

.project-with-gallery .project-slideshow {
    margin-top: 20px;
}

.project-description {
    text-align: justify;
    display: grid;
    gap: 14px;
    margin-top: 24px;
    color: var(--winter-copy, #bfc2cb);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.project-stack li {
    padding: 4px 8px;
    border: 1px solid var(--winter-line, #535865);
    border-radius: 4px;
    background: var(--winter-panel, #1b1d21);
    color: var(--winter-ice, #b9ceff);
    font-size: 0.75rem;
    font-weight: 600;
}

.project-repo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 12px;
    border: 1px solid var(--winter-line, #535865);
    border-radius: 4px;
    color: var(--winter-snow, #f4f4f5);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.project-repo-link:is(:hover, :focus-visible) {
    border-color: var(--winter-ice, #b9ceff);
    background: var(--winter-panel, #1b1d21);
    color: var(--winter-ice, #b9ceff);
}
