.portfolio-page .portfolio-back {
    display: flex;
    width: fit-content;
    margin-top: 56px !important;
    margin-bottom: 0 !important;
}

.portfolio-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 64px;
    padding: 12px 21px;

    font-family: "Chakra Petch", Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    color: #ffffff;

    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #ed6623;
    border-radius: 999px;
    box-shadow:
        0 0 5px rgba(216, 107, 6, 0.6),
        inset 0 0 6px rgba(255, 140, 45, 0.15);

    -webkit-tap-highlight-color: transparent;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.portfolio-back:hover,
.portfolio-back:focus-visible,
.portfolio-back:active {
    transform: translateX(-3px);
    color: #9ff0ff;
    border-color: #4de1ff;
    box-shadow:
        0 0 8px rgba(77, 225, 255, 0.85),
        0 0 24px rgba(77, 225, 255, 0.45),
        inset 0 0 8px rgba(77, 225, 255, 0.2);
    outline: none;
}

.style-card.blackwork   { background: url("images/black1.webp") center / cover no-repeat; }
.style-card.delicate    { background: url("images/delicada1.webp") center / cover no-repeat; }
.style-card.fine-line   { background: url("images/fine1.webp") center / cover no-repeat; }
.style-card.anime-gray  { background: url("images/anime1.webp") center 32% / cover no-repeat; }
.style-card.colorida    { background: url("images/colorida1.webp") center / cover no-repeat; }
.style-card.dupla       { background: url("images/dupla1.webp") center / cover no-repeat; }
.style-card.escrita     { background: url("images/escrita1.webp") center / cover no-repeat; }
.style-card.preto-cinza { background: url("images/peb1.webp") center / cover no-repeat; }

/* Caneta de luz verde em volta de cada cartão */
.portfolio-mosaic .style-card {
    border: 1px solid #28ff9f;
    box-shadow:
        0 0 5px rgba(40, 255, 159, 0.6),
        inset 0 0 6px rgba(40, 255, 159, 0.15);
}

/* Mouse por cima, foco pelo teclado ou dedo encostado: salta e brilha azul claro */
.portfolio-mosaic .style-card:hover,
.portfolio-mosaic .style-card:focus-visible,
.portfolio-mosaic .style-card:active {
    transform: translateY(-5px);
    border-color: #4de1ff;
    box-shadow:
        0 0 8px rgba(77, 225, 255, 0.85),
        0 0 24px rgba(77, 225, 255, 0.45),
        inset 0 0 8px rgba(77, 225, 255, 0.2),
        0 12px 30px rgba(0, 0, 0, 0.6);
}

.portfolio-mosaic .style-card:hover .style-number,
.portfolio-mosaic .style-card:focus-visible .style-number,
.portfolio-mosaic .style-card:active .style-number,
.portfolio-mosaic .style-card:hover .style-enter,
.portfolio-mosaic .style-card:focus-visible .style-enter,
.portfolio-mosaic .style-card:active .style-enter {
    color: #9ff0ff;
}

.portfolio-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 56px 24px 90px;
}

.portfolio-heading {
    margin-bottom: 40px;
}

.portfolio-label {
    margin: 0 0 10px;
    font-family: "Chakra Petch", Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 5px;
    color: #28ff9f;
}

.portfolio-heading h1,
.portfolio-heading h2 {
    margin: 0 0 12px;
    font-family: "Chakra Petch", Arial, sans-serif;
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.5), 0 0 14px rgba(40, 255, 159, 0.45);
}

.portfolio-description {
    margin: 0;
    font-size: 17px;
    line-height: 1.6;
    color: #b5b5b5;
}

.portfolio-mosaic {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: clamp(150px, 19vw, 240px);
    gap: 14px;
}

.portfolio-mosaic .style-card:nth-child(1) { grid-column: 1 / 7;   grid-row: 1; }
.portfolio-mosaic .style-card:nth-child(2) { grid-column: 7 / 10;  grid-row: 1; }
.portfolio-mosaic .style-card:nth-child(3) { grid-column: 10 / 13; grid-row: 1; }
.portfolio-mosaic .style-card:nth-child(5) { grid-column: 1 / 4;   grid-row: 2; }
.portfolio-mosaic .style-card:nth-child(6) { grid-column: 4 / 7;   grid-row: 2; }
.portfolio-mosaic .style-card:nth-child(4) { grid-column: 7 / 13;  grid-row: 2; }
.portfolio-mosaic .style-card:nth-child(7) { grid-column: 1 / 4;   grid-row: 3; }
.portfolio-mosaic .style-card:nth-child(8) { grid-column: 4 / 13;  grid-row: 3; }

.style-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 0;
    margin: 0;
    font: inherit;
    color: #ffffff;
    text-align: left;
    background: linear-gradient(145deg, #1a1a1a, #090909);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.style-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: var(--card-img, none) center / cover no-repeat;
    transition: transform 0.6s ease;
}

.style-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0) 100%);
}

.style-card:hover,
.style-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(40, 255, 159, 0.8);
    box-shadow: 0 0 14px rgba(40, 255, 159, 0.35), 0 10px 30px rgba(0, 0, 0, 0.6);
    outline: none;
}

.style-card:hover::before {
    transform: scale(1.06);
}

.style-card-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 6px;
    padding: 22px;
}

.style-number {
    font-family: "Chakra Petch", Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #28ff9f;
}

.style-card h3 {
    margin: 0;
    font-family: "Chakra Petch", Arial, sans-serif;
    font-size: clamp(18px, 2vw, 26px);
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.1;
    text-shadow: 0 0 10px #000;
}

.style-card-large h3 {
    font-size: clamp(22px, 2.8vw, 36px);
}

.style-enter {
    font-size: 13px;
    letter-spacing: 1px;
    color: #bfffe0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.style-card:hover .style-enter,
.style-card:focus-visible .style-enter {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: none) {
    .style-enter {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 900px) {
    .portfolio-mosaic {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: clamp(140px, 30vw, 220px);
    }

    .portfolio-mosaic .style-card:nth-child(n) {
        grid-column: span 1;
        grid-row: auto;
    }

    .portfolio-mosaic .style-card-large:nth-child(n) {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .portfolio-page {
        padding: 36px 16px 70px;
    }

    .portfolio-mosaic {
        gap: 10px;
        grid-auto-rows: 150px;
    }

    .style-card-content {
        padding: 14px;
    }
}

.gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    background: rgba(0, 0, 0, 0.94);
}

.gallery-overlay.active,
.gallery-overlay.open,
.gallery-overlay.show,
.gallery-overlay.visible,
.gallery-overlay.is-open,
.gallery-overlay.is-active,
.gallery-overlay.gallery-open {
    display: block;
}

.gallery-close {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 2;
    width: 46px;
    height: 46px;
    padding: 0;
    font-size: 28px;
    line-height: 1;
}
