/* Ficheiro: /components/header/header.css */

header {
    /* Transição suave do header quando a barra de contagem aparece/desaparece. */
    transition: top 0.5s ease-in-out;
}

/* --- Cursor do efeito "máquina de escrever" no subtítulo do header --- */
.role-cursor {
    display: inline-block;
    margin-left: 1px;
    font-weight: 400;
    color: var(--green);
    animation: roleCursorBlink 1s steps(1) infinite;
}

@keyframes roleCursorBlink {
    0%, 50%   { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .role-cursor { animation: none; opacity: 0; }
}

/* ============================================================
   GAVETA LATERAL (MOBILE DRAWER) — entrada suave pela direita
   ============================================================ */

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 82%;
    max-width: 340px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    background: rgba(10, 12, 18, 0.97);
    backdrop-filter: blur(14px);
    border-left: 1px solid rgba(0, 255, 157, 0.18);
    box-shadow: -18px 0 50px rgba(0, 0, 0, 0.55);
    /* Estado fechado: fora do ecrã à direita. */
    transform: translateX(105%);
    /* Easing "doce" (cubic-bezier suave) — coerente com o resto do site. */
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    overflow-y: auto;
}

.mobile-drawer.open {
    transform: translateX(0);
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.42s ease, visibility 0.42s ease;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Impede o scroll do body quando a gaveta está aberta. */
body.drawer-locked {
    overflow: hidden;
}

/* Links da gaveta — aparecem em cascata suave quando abre. */
.drawer-link {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #d1d5db;
    transition: background-color 0.25s ease, color 0.25s ease, padding-left 0.25s ease;
    opacity: 0;
    transform: translateX(16px);
}

.mobile-drawer.open .drawer-link {
    animation: drawerLinkIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Pequeno atraso encadeado para um efeito de entrada agradável. */
.mobile-drawer.open .drawer-link:nth-child(1) { animation-delay: 0.06s; }
.mobile-drawer.open .drawer-link:nth-child(2) { animation-delay: 0.10s; }
.mobile-drawer.open .drawer-link:nth-child(3) { animation-delay: 0.14s; }
.mobile-drawer.open .drawer-link:nth-child(4) { animation-delay: 0.18s; }
.mobile-drawer.open .drawer-link:nth-child(5) { animation-delay: 0.22s; }
.mobile-drawer.open .drawer-link:nth-child(6) { animation-delay: 0.26s; }
.mobile-drawer.open .drawer-link:nth-child(7) { animation-delay: 0.30s; }
.mobile-drawer.open .drawer-link:nth-child(8) { animation-delay: 0.34s; }

.drawer-link:hover {
    background-color: rgba(0, 255, 157, 0.08);
    color: #00ff9d;
    padding-left: 1.85rem;
}

@keyframes drawerLinkIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Acessibilidade: respeita quem prefere menos movimento. */
@media (prefers-reduced-motion: reduce) {
    .mobile-drawer,
    .drawer-overlay,
    .drawer-link {
        transition: none;
        animation: none;
        opacity: 1;
        transform: none;
    }
}
