@font-face {
    font-family: 'Leonardo';
    src: url('assets/font/leonardo.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --accent: rgba(255, 255, 255, 0.85);
    --panel-width: 420px;
    --bg-color: #111;
    --bg-image: url('assets/img/bg-pc.webp');
    --text-color: var(--accent);
    --transition-fast: 200ms ease;
}

[data-theme="light"] {
    --bg-color: #fafafa;
    --text-color: #222;
    --accent: #333;
    --glass-bg: rgba(255, 255, 255, 0.2);
    --glass-border: rgba(0, 0, 0, 0.08);
    --bg-image: url('assets/img/bg-pc.webp');
    --overlay-bg: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .gallery-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

header {
    position: fixed;
    margin: 10px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 9999;
}

header .logo {
    position: relative;
    left: auto;
    top: auto;
}

header .socials {
    position: relative;
    gap: 12px;
}


html,
body {
    height: 100%;
    margin: 0;
    font-family: Poppins, system-ui, Segoe UI, Roboto, -apple-system, 'Helvetica Neue', Arial;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.site-footer {
    text-align: center;
    padding: 12px 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: auto;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    pointer-events: none;
    z-index: 0;
}

.logo {
    position: fixed;
    left: 20px;
    top: 18px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
}

.logo svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6))
}

main.center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    width: 100%;
    height: 100%
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 40px 56px;
    border-radius: 16px;
    text-align: center;
    max-width: 90%;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
}

.glass-card {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

h1.name {
    font-family: 'Leonardo', serif;
    font-size: 48px;
    margin: 0;
    color: var(--accent);
    letter-spacing: 2px;
}

.socials {
    display: flex;
    gap: 18px;
    align-items: center
}

.socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 18px
}

.socials a:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px)
}

.side-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: var(--panel-width);
    max-width: 100%;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transform: translateX(100%);
    transition: transform 420ms cubic-bezier(.2, .9, .2, 1);
}

.side-panel.open {
    transform: translateX(0)
}

.toggle {
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    transition: transform 220ms ease, background 200ms, right 420ms cubic-bezier(.2, .9, .2, 1);
    z-index: 7
}

.hamburger {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.card .hamburger {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    z-index: 1;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg, rgba(0, 0, 0, 0.9));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 300ms cubic-bezier(.2, .9, .2, 1), visibility 0ms linear 300ms;
}

.overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.overlay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 32px;
    color: var(--accent);
    background: transparent;
    border: none;
    cursor: pointer;
}

.gallery-cards {
    display: grid;
    gap: 24px;
    /* each column gets at least 260px before shrinking, making cards wider */
    grid-template-columns: repeat(2, 1fr);
    width: 90%;
    max-width: 900px;
    /* allow more overall width for bigger cards */
    padding: 20px 0px 40px 0px;
    margin: 6 auto;
}

@media (min-width: 1024px) {
    .gallery-cards {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
    }
}

@media (min-width: 1440px) {
    .gallery-cards {
        grid-template-columns: repeat(5, 1fr);
        max-width: 1400px;
    }
}

.gallery-card {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.2));
    border-radius: 12px;
    padding: 24px 22px;
    /* mais espaço nas laterais */
    color: var(--text-color);
    text-align: center;
}

/* glass override */
.gallery-card.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(14px);
}

.gallery-card .card-img {
    width: 100%;
    height: 250px;
    /* ============================== altura dos cards imagem ============================== */
    border-radius: 8px;
    /* expanded width due to larger card container */
    margin-bottom: 12px;
    object-fit: cover;
}

/* base (hidden) state for cards */
.gallery-card {
    opacity: 0;
    transform: translateY(10px);
    will-change: opacity, transform;
}

/* entrance when overlay opens */
.overlay.open .gallery-card {
    animation: cardIn 420ms cubic-bezier(.2, .9, .2, 1) forwards;
}

.overlay.open .gallery-cards .gallery-card:nth-child(1) {
    animation-delay: 0ms;
}

.overlay.open .gallery-cards .gallery-card:nth-child(2) {
    animation-delay: 80ms;
}

.overlay.open .gallery-cards .gallery-card:nth-child(3) {
    animation-delay: 160ms;
}

.overlay.open .gallery-cards .gallery-card:nth-child(4) {
    animation-delay: 240ms;
}

.overlay.open .gallery-cards .gallery-card:nth-child(5) {
    animation-delay: 320ms;
}

/* exit animation when overlay closes */
.overlay:not(.open) .gallery-card {
    animation: cardOut 260ms cubic-bezier(.2, .9, .2, 1) forwards;
}

.overlay:not(.open) .gallery-cards .gallery-card:nth-child(1) {
    animation-delay: 320ms;
}

.overlay:not(.open) .gallery-cards .gallery-card:nth-child(2) {
    animation-delay: 240ms;
}

.overlay:not(.open) .gallery-cards .gallery-card:nth-child(3) {
    animation-delay: 160ms;
}

.overlay:not(.open) .gallery-cards .gallery-card:nth-child(4) {
    animation-delay: 80ms;
}

.overlay:not(.open) .gallery-cards .gallery-card:nth-child(5) {
    animation-delay: 0ms;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

.toggle:active {
    transform: translateY(-50%) scale(.98)
}

.toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--accent);
    transition: transform 300ms ease
}

.side-panel.open+.toggle svg {
    transform: rotate(180deg)
}

.side-panel.open+.toggle {
    right: calc(var(--panel-width) - 24px)
}

.panel-inner {
    margin-left: auto;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 40px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
}

.panel-inner.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(14px);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.profile {
    width: 100%;
    max-width: 350px;
    object-fit: cover;
    margin: 0 auto 24px auto;
    display: block;
}

@media (min-width: 900px) {
    .profile {
        width: 60%;
        max-width: 100px;
        margin-bottom: 28px;
    }
}

.desc {
    padding-left: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.5;
}

.panel-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

@media (max-width:900px) {
    h1.name {
        font-size: 36px
    }

    .card {
        padding: 28px
    }

    .profile {
        max-width: 140px
    }
}

@media (max-width:640px) {
    body {
        background-image: url('assets/img/bg.webp')
    }

    header {
        padding: 0 12px;
    }

    .side-panel {
        width: 100%;
    }

    .panel-inner {
        padding: 20px
    }

    h1.name {
        font-size: 28px
    }

    .profile {
        display: block;
        width: 50%;
        max-width: none;
        margin-bottom: 20px
    }

    :root {
        --panel-width: 100vw
    }

    .panel-content {
        flex-direction: column;
        align-items: flex-start
    }

    .toggle {
        right: 12px
    }

    .overlay {
        align-items: flex-start;
        justify-content: flex-start;
        padding: 60px 12px 20px 12px;
        padding-top: 90px;
    }

    .gallery-cards {
        width: 100%;
        padding-top: 0px;
        gap: 16px;
        grid-template-columns: 1fr;
    }

    .gallery-card {
        margin-top: 6px;
        padding: 18px;
    }

    .gallery-card .card-img {
        height: 200px;
    }
}