.menu[hidden] { visibility: hidden; pointer-events: none; transform: scaleY(0); }
.portfolio-bg { padding: 80px 0; }
.portfolio { display: flex; gap: 30px; align-items: flex-start; }
.portfolio-selector { position: sticky; top: 20px; z-index: 2; width: 100%; max-width: 360px; font-family: gotham; }
.portfolio-selector-toggle { display: none; }
.portfolio-selector-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.portfolio-selector-label { font: 12px gotham; text-transform: uppercase; letter-spacing: 0.08em; color: #7f7f7f; }
.portfolio-selector-current { font: 22px gotham; font-weight: 700; color: var(--preto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portfolio-selector-icon { width: 12px; height: 12px; flex: 0 0 auto; border-right: 2px solid #c8102e; border-bottom: 2px solid #c8102e; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s ease; }
.portfolio-selector.open .portfolio-selector-icon { transform: rotate(-135deg) translateY(-1px); }
.menu { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 360px; }
.menu-item { position: relative; width: 100%; padding: 0; background: var(--branco); border: 1.5px solid #f5c8ca; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; cursor: pointer; --fill: 0%; transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.menu-item::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, #c8102e 0%, #9e0c24 100%); clip-path: inset(0 100% 0 0); transition: clip-path 0.45s cubic-bezier(0.77, 0, 0.18, 1); z-index: 0; }
.menu-item::after { content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; background: linear-gradient( 120deg, transparent 0%, rgba(255, 255, 255, 0.18) 50%, transparent 100% ); transform: skewX(-20deg); transition: left 0.55s ease; z-index: 2; pointer-events: none; }
.menu-item .text { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; font: 27px gotham; color: var(--preto); transition: color 0.3s ease; }
.menu-item .text::after { content: "\203A"; font-size: 22px; font-weight: 700; color: #c8102e; line-height: 1; transform: translateX(0); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease; }
.menu-item .text b { font-weight: 800; }
.menu-item:hover { border-color: #c8102e; box-shadow: var(--shadow-hover); transform: translateY(-2px) scale(1.015); }
.menu-item:hover::before { clip-path: inset(0 0% 0 0); }
.menu-item:hover::after { left: 125%; }
.menu-item:hover .text { color: var(--branco); }
.menu-item:hover .text::after { color: var(--branco); transform: translateX(5px); }
.menu-item:active { transform: translateY(0) scale(0.99); box-shadow: 0 2px 8px rgba(200, 16, 46, 0.35); }
.menu-item.ativo { background: linear-gradient(135deg, #c8102e 0%, #9e0c24 100%); border-color: #9e0c24; box-shadow: 0 4px 20px rgba(200, 16, 46, 0.35); }
.menu-item.ativo::before { display: none; }
.menu-item.ativo .text { color: var(--branco); font-weight: 700; }
.menu-item.ativo .text::after { color: var(--branco); }
.menu-item.ativo:hover { box-shadow: 0 8px 28px rgba(200, 16, 46, 0.35); transform: translateY(-2px) scale(1.015); }
.portfolio-selector-toggle:focus-visible,
.menu-item:focus-visible { outline: 2px solid #c8102e; outline-offset: 3px; }
.portfolio-items { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px; transition: opacity 0.24s ease, transform 0.24s ease; will-change: opacity, transform; }
.portfolio-items.is-transitioning { opacity: 0; transform: translateY(10px); }
.portfolio-items .portfolio-item { animation: portfolio-item-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; cursor: zoom-in; }
.portfolio-items .portfolio-item .img { display: flex; overflow: hidden; border-radius: 10px; }
.portfolio-items .portfolio-item img { width: 100%; height: 100%; object-fit: cover; }
.portfolio-empty { margin: 0; grid-column: 1/-1; padding: 14px 18px; border-radius: 10px; border: 1px dashed #f5c8ca; background: #fff8f8; font: 16px gotham; color: #7d4047; animation: portfolio-item-in 0.3s ease both; }
.portfolio-items:has(.portfolio-empty) { justify-items: center; margin: 0 auto; }
body.portfolio-modal-open { overflow: hidden; }
.portfolio-modal[hidden] { display: none; }
.portfolio-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.portfolio-modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0, 0, 0, 0.82); cursor: pointer; }
.portfolio-modal-dialog { position: relative; z-index: 1; width: 100%; max-width: min(1180px, calc(100vw - 48px)); max-height: calc(100vh - 48px); display: flex; align-items: center; justify-content: center; }
.portfolio-modal-image { display: block; width: auto; max-width: 100%; max-height: calc(100vh - 48px); border-radius: 14px; background: var(--branco); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35); }
.portfolio-modal-close { position: absolute; top: -18px; right: 170px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, 0.72); color: var(--branco); font: 28px/1 gotham; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease; }
.portfolio-modal-close:hover { background: rgba(200, 16, 46, 0.9); transform: scale(1.04); }
.portfolio-modal-close:focus-visible { outline: 2px solid var(--branco); outline-offset: 3px; }

@keyframes portfolio-item-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 990px) {
    .portfolio-bg { padding: 56px 0; }
    .portfolio { flex-direction: column; gap: 18px; }
    .portfolio-selector { max-width: 100%; }
    .portfolio-selector-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px 14px 18px; border: 1.5px solid #f5c8ca; border-radius: 12px; background: var(--branco); box-shadow: var(--shadow); cursor: pointer; text-align: left; transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease; }
    .portfolio-selector-toggle:hover { border-color: #c8102e; box-shadow: var(--shadow-hover); transform: translateY(-1px); }
    .portfolio-selector-current { font-size: 18px; }
    .portfolio-selector.open .menu { display: flex; }
    .menu { position: absolute; transition: .4s; transform-origin: top; top: calc(100% + 10px); box-sizing: border-box; left: 0; width: 100%; max-width: 100%; overflow-y: auto; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid #f5c8ca; border-radius: 12px; background: var(--branco); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12); z-index: 20; transform: scaleY(1); }
    .menu-item .text { padding: 12px 14px; font-size: 16px; }
    .menu-item .text::after { font-size: 18px; }
    .portfolio-items { gap: 15px; grid-template-columns: 1fr; }
    .portfolio-modal { padding: 16px; }
    .portfolio-modal-dialog { max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); }
    .portfolio-modal-image { max-height: calc(100vh - 32px); border-radius: 12px; }
    .portfolio-modal-close { top: 8px; right: 8px; width: 40px; height: 40px; font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-items { transition: none; }
    .portfolio-items.is-transitioning { opacity: 1; transform: none; }
    .portfolio-items .portfolio-item,
    .portfolio-empty { animation: none; }
}
