.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    --size: 20px;
    --accent: #3b82f6;
    --accent-rgb: 59, 130, 246;
    --bg-dark: #020617;
    --glass: rgba(15, 23, 42, 0.9);
    --glass-border: rgba(59, 130, 246, 0.2);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
}

body.atmosphere-purple {
    --accent: #a855f7;
    --accent-rgb: 168, 85, 247;
    --glass-border: rgba(168, 85, 247, 0.2);
}

body.atmosphere-green {
    --accent: #22c55e;
    --accent-rgb: 34, 197, 94;
    --glass-border: rgba(34, 197, 94, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

body.no-scroll {
    overflow: hidden !important;
}

.content-visible {
    overflow-y: auto !important;
    height: auto !important;
}

/* === VIEWPORT & BACKGROUND === */
#hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    z-index: 50;
    background: transparent;
    pointer-events: none;
}

.viewport-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

#starCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.cube-scene {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.cube-container {
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* === BRANDING (CORE TEXT) === */
.text-core {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 1000;
    opacity: 0;
    filter: blur(10px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.brand-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 2rem;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    position: relative;
}

.text-core.is-navbar {
    top: 20px !important;
    left: 50% !important;
    transform: translate(-50%, 0) scale(0.65) !important;
    opacity: 1 !important;
    filter: blur(0) !important;
    z-index: 5000 !important;
}

.text-core.is-navbar .brand-wrapper {
    flex-direction: row !important;
    padding: 6px 16px !important;
    background: rgba(var(--bg-dark-rgb, 15, 23, 42), 0.85) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 50px !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
}

.group {
    display: flex;
    gap: 0.1rem;
}

.letter {
    font-family: 'Michroma', sans-serif;
    text-transform: uppercase;
}

/* === SCROLL HINT === */
.scroll-hint {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    z-index: 1001;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: none;
}

.scroll-hint.visible {
    opacity: 1;
}

.scroll-hint i {
    width: 20px;
    height: 20px;
    color: var(--accent);
    animation: bounce 2s infinite;
}

.scroll-hint span {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-6px);
    }

    60% {
        transform: translateY(-3px);
    }
}

.group:first-child .letter {
    font-size: 3rem;
    color: var(--accent);
    font-weight: 900;
}

.group:not(:first-child) .letter {
    font-size: 1.2rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-core.is-navbar .group:first-child .letter {
    font-size: 1.8rem;
}

.text-core.is-navbar .group:not(:first-child) .letter {
    font-size: 1rem;
}

/* === STICKY LAYOUT === */
.main-content {
    position: relative;
    z-index: 100;
    background: #020617;
    margin-top: 10vh;
    /* Reduzido de 100vh para evitar o buraco imenso */
    opacity: 1 !important;
    transform: none !important;
}

.sticky-wrapper,
.sticky-content {
    height: auto !important;
    min-height: 0 !important;
    position: relative !important;
    top: auto !important;
    overflow: visible !important;
    display: block !important;
    padding: 0 !important;
}

#projects-feed {
    display: flex !important;
    flex-direction: column !important;
    gap: 2.5rem !important;
    height: auto !important;
    padding: 1rem 1.5rem !important;
}

#projects-feed .project-card {
    position: relative !important;
    width: 100% !important;
    min-height: 400px !important;
    background: #0f172a !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px !important;
    opacity: 1 !important;
    transform: none !important;
    display: block !important;
    margin-bottom: 2rem !important;
    z-index: 10;
    overflow: hidden !important;
}

.project-cover {
    width: 100% !important;
    height: 220px !important;
    background-size: cover !important;
    background-position: center !important;
    border-bottom: 1px solid var(--glass-border) !important;
}

h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 200;
    text-align: center;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 4rem 0 3rem;
    position: relative;
    z-index: 10;
}

.social-card {
    grid-area: auto !important;
    height: 80px !important;
    /* Mais compacto */
    opacity: 1;
    transform: none;
    pointer-events: auto !important;
    position: relative;
    display: block;
    width: 100%;
    background: rgba(var(--accent-rgb), 0.05) !important;
}

.social-card .card-content-wrapper {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0.5rem 1rem !important;
}

.social-card h3 {
    font-size: 0.9rem !important;
}

.social-card p {
    font-size: 0.7rem !important;
}

#social-feed {
    display: flex !important;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    height: auto !important;
    padding: 0;
    /* Removido padding para aproximar do h2 */
}

.card-quadrant {
    position: absolute;
    width: 51%;
    height: 51%;
    overflow: hidden;
    z-index: 1;
    transition: transform 0s, opacity 0s;
}

.q-inner {
    position: absolute;
    width: 200%;
    height: 200%;
    background-size: cover;
    background-position: center;
}

.q-tl {
    top: 0;
    left: 0;
}

.q-tr {
    top: 0;
    right: 0;
}

.q-bl {
    bottom: 0;
    left: 0;
}

.q-br {
    bottom: 0;
    right: 0;
}

.q-tl .q-inner {
    top: 0;
    left: 0;
}

.q-tr .q-inner {
    top: 0;
    right: 0;
}

.q-bl .q-inner {
    bottom: 0;
    left: 0;
}

.q-br .q-inner {
    bottom: 0;
    right: 0;
}

.card-content-wrapper {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.9) 20%, transparent 80%);
}

.card-info h3 {
    font-size: 1.1rem;
    color: white;
}

.card-info p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.card-number {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.6rem;
    color: var(--accent);
    font-weight: 900;
}

/* === SOCIAL CARDS === */
.social-card {
    height: 100px;
}

.social-feed {
    display: flex !important;
    flex-direction: column;
    gap: 1rem;
    height: auto !important;
}

/* === THEME TOGGLE (ECLIPSE) === */
.energy-core-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
}

.theme-toggle {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.theme-toggle--toggled .eclipse-path {
    d: path("M0 0h64v32h-64zm12 16a1 1 0 0020 0 1 1 0 00-20 0");
}

/* === LANGUAGE SELECTOR === */
.lang-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(30px);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.lang-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.lang-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.lang-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lang-header {
    text-align: center;
    margin-bottom: 2rem;
}

.lang-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: white;
}

.lang-header .it-sub {
    font-size: 0.9rem;
    color: var(--accent);
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centraliza conteúdo interno */
    gap: 1.5rem;
    width: 250px;
    margin: 0 auto;
    /* Garante centralização no container */
}

.lang-btn img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

/* === FIXED LANG SWITCHER === */
.lang-fixed {
    position: fixed;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.content-visible .lang-fixed {
    opacity: 1;
    pointer-events: auto;
}

.fixed-lang-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fixed-lang-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fixed-lang-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* === MODAL HUD === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(20px);
    z-index: 5000;
    display: none;
    padding: 10px;
    align-items: flex-end;
}

.modal-overlay.active {
    display: flex;
}

.modal-hud {
    background: #0f172a;
    width: 100%;
    max-height: 90vh;
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.hud-visual {
    width: 100%;
    height: 250px;
    position: relative;
}

.hud-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.nav-hud-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-hud-btn:active {
    scale: 0.9;
    background: rgba(var(--accent-rgb), 0.2);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.4);
}

.nav-hud-btn.prev {
    left: 10px;
}

.nav-hud-btn.next {
    right: 10px;
}

.nav-hud-btn i {
    width: 24px;
    height: 24px;
}

.hud-details {
    padding: 1.5rem;
}

.hud-header h2 {
    font-size: 1.5rem;
    text-align: left;
    margin: 0 0 1rem;
}

.hud-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.grid-item {
    background: rgba(var(--accent-rgb), 0.1);
    padding: 10px;
    border-left: 2px solid var(--accent);
}

.grid-item label {
    font-size: 0.6rem;
    color: var(--accent);
    display: block;
}

.grid-item span {
    font-size: 0.9rem;
    font-weight: bold;
}

.close-hud-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    z-index: 10;
}

/* === LOADER === */
.logo-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    z-index: 3500;
    /* Abaixo do seletor de idiomas (4000) */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-loader.loader-up {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.logo-loader.hidden {
    display: none;
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 32px;
    fill: white;
    filter: drop-shadow(0 0 15px var(--accent));
}

/* === FOOTER === */
.main-footer {
    padding: 3rem 1rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.footer-brand h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.footer-brand p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}