/* ============================================================
    R&R INVESTIMENTOS — Design Tokens
    Paleta: verde-floresta de marca (inalterado) + latão apagado
    (novo acento, alusivo a selos/escrituras) + tons de pergaminho
    sobre uma base quase-preta fria.
   ============================================================ */
:root {
    --rr-ink: #07090a;
    --rr-ink-soft: #0e1311;
    --rr-forest: #064721;
    --rr-forest-light: #0e8c46;
    --rr-brass: #a6926a;
    --rr-brass-soft: rgba(166, 146, 106, 0.35);
    --rr-parchment: #ece7da;
    --rr-mist: #aeb6b0;
    --rr-line: rgba(236, 231, 218, 0.12);

    --space-3xs: 4px;
    --space-2xs: 8px;
    --space-xs: 12px;
    --space-sm: 18px;
    --space-md: 28px;
    --space-lg: 44px;
    --space-xl: 72px;
    --space-2xl: 104px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- NOVA COR DE SELEÇÃO (Highlight Verde R&R) --- */
::selection {
    background: var(--rr-forest);
    color: #ffffff;
    text-shadow: none;
}
::-moz-selection {
    background: var(--rr-forest);
    color: #ffffff;
    text-shadow: none;
}

/* --- RESET GERAL --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Foco visível apenas para navegação por teclado — mantém o clique do
   mouse limpo, mas nunca esconde o foco de quem navega via Tab. */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--rr-brass);
    outline-offset: 3px;
    border-radius: 2px;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--rr-ink);
    color: var(--rr-parchment);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Camada de ruído sutil por cima de tudo */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.035;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWjAAAAG1BMVEUaGhouLi4mJiYkJCQoKCgpKSkqKiorKyssLCw1U1fOAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABSUlEQVQ4jWNgYBASECgg4LhAIIaCqQoKjFAWjK2iYIoQYmCgYKoA8RkZACFjK5gaCMYQYmBgqgDxpRkZACFjK5g6CIwFhBgYmCpAfGkGCAcIQ+RgaoAYQoiBkakCxJdmYACEDFAWjK2CqQkQYmBgaoCYQoiBkakCxJdmgHBAyAClwdgqmJoAIRYGpgYQj6ECxpdmYACEDFASjK2CqQlIiIGBqQHEWECIgaGpgsBYIBygJBhbBVMToIiBgaEChJdmYAAIGaAsGFsFUxOEGCAcGPoYKoB8aQYIgZABSgOErYKpCUIMDFAcGCqAfGkGCAcIGaA0GFsFUxOQEAOEA0MDUwWQL80AwQZCBigNxlbB1AQhBgaGCgaGCiBfmgHCAUIGKA3GVsHUBCbEwMBUAeJLM0B8IGSAMGBsFQwFADuW+5wFqE48AAAAAElFTkSuQmCC');
}

/* --- PRE-LOADER (INTRO) --- */
.intro-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--rr-ink);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: curtainUp 1.5s var(--ease-out) 3s forwards;
    pointer-events: none;
}

.intro-logo {
    max-width: 180px;
    opacity: 0;
    animation: logoFadeIn 1.4s var(--ease-out) 0.5s forwards;
}

/* --- VÍDEO DE FUNDO --- */
.video-bg {
    position: fixed;
    top: 50%; left: 50%;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    transform: translate(-50%, -50%) scale(1.1);
    object-fit: cover;
    z-index: -2;
    filter: blur(10px) brightness(0.55);
}

/* --- MÁSCARA --- */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(6, 71, 33, 0.22) 0%, rgba(5, 6, 6, 0.94) 80%);
    z-index: -1;
}

/* --- MOLDURA CINEMATOGRÁFICA (elemento de assinatura) ---
    Linha fina inset + marcas de canto em latão, como um selo de
    registro de instrumento/levantamento. Único elemento "ousado"
   da página — discreto de propósito. */
.cinematic-frame {
    position: fixed;
    inset: 16px;
    border: 1px solid var(--rr-line);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    animation: frameReveal 2s var(--ease-out) 3.4s forwards;
}

.frame-tick {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1px solid var(--rr-brass);
    opacity: 0.55;
}
.tick-tl { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.tick-tr { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.tick-bl { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }
.tick-br { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* --- CONTEÚDO PRINCIPAL --- */
.hero-content {
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 760px;
    padding: 0 var(--space-md);
    opacity: 0;
    animation: contentFadeIn 1.8s var(--ease-out) 3.5s forwards;
    transition: filter 0.6s ease, opacity 0.6s ease;
}

body.footer-open .hero-content {
    filter: blur(6px);
    opacity: 0.35;
}

.logo-img {
    max-width: 320px;
    height: auto;
    margin-bottom: var(--space-lg);
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.8));
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--rr-brass);
    margin-bottom: var(--space-sm);
}

.eyebrow::before,
.eyebrow::after {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--rr-brass-soft);
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.1rem, 1.1rem + 3.4vw, 3.6rem);
    font-weight: 400;
    color: #ffffff;
    margin-bottom: var(--space-sm);
    line-height: 1.16;
    letter-spacing: -0.01em;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.9);
}

h1 span {
    color: var(--rr-mist);
    font-style: italic;
    border-bottom: 1px solid var(--rr-brass-soft);
    padding-bottom: 2px;
}

p.subtitle {
    font-size: clamp(0.95rem, 0.85rem + 0.3vw, 1.05rem);
    color: #cfd3cf;
    font-weight: 300;
    line-height: 1.75;
    margin-bottom: 0;
    max-width: 580px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* --- HEADER MINIMALISTA (logo + ações em texto puro) --- */
.site-nav {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px clamp(20px, 4vw, 56px);
    opacity: 0;
    animation: contentFadeIn 1.8s var(--ease-out) 3.5s forwards;
    transition: filter 0.6s ease, opacity 0.6s ease;
}

body.footer-open .site-nav {
    filter: blur(6px);
    opacity: 0.35;
}

.nav-logo {
    height: 55px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
    transition: height 0.3s ease;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
}

.nav-link {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    transition: color 0.3s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0; bottom: -6px;
    width: 0%;
    height: 1px;
    background: var(--rr-brass);
    transition: width 0.4s var(--ease-out);
}

.nav-link:hover { color: #ffffff; }
.nav-link:hover::after { width: 100%; }

/* --- MODAL "LIQUID GLASS" --- */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(4, 5, 5, 0.45);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s var(--ease-out);
    overflow-y: auto; 
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 450px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(50px) saturate(150%);
    -webkit-backdrop-filter: blur(50px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.02), 0 40px 80px rgba(0, 0, 0, 0.6);
    border-radius: 22px;
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    text-align: left;
    transform: scale(0.92) translateY(36px);
    opacity: 0;
    transition: all 0.6s var(--ease-spring);
    max-height: 85vh; 
    overflow-y: auto; 
}

/* O formulário de cadastro recebe mais respiro: dois campos por linha
   pedem mais largura para não ficar apertado (ver .form-row). */
.modal-content--wide { max-width: 600px; }

.modal-backdrop.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-header h2 {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
    margin-bottom: var(--space-2xs);
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.modal-header p {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: var(--space-lg);
    font-weight: 300;
    line-height: 1.6;
    max-width: 90%;
}

.close-modal {
    position: absolute;
    top: 22px; right: 22px;
    background: rgba(255, 255, 255, 0.05);
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s var(--ease-out);
}

.close-modal:hover {
    background: var(--rr-parchment);
    color: var(--rr-ink);
    transform: rotate(90deg);
}

/* --- FORMULÁRIO --- */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.form-group { margin-bottom: var(--space-md); }

.form-group label {
    display: block;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: var(--space-2xs);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 15px 16px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.98rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.form-input::placeholder { color: rgba(255, 255, 255, 0.28); }

.form-input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--rr-brass);
    box-shadow: 0 0 0 1px var(--rr-brass-soft), 0 0 26px rgba(166, 146, 106, 0.16);
}

.submit-btn {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 18px;
    background: var(--rr-parchment);
    color: var(--rr-ink);
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.82rem;
    margin-top: var(--space-2xs);
    transition: all 0.35s var(--ease-out);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.submit-btn:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

/* --- TESE: LISTA NUMERADA (processo real, por isso a numeração) --- */
.thesis-content {
    color: var(--rr-mist);
    font-size: 0.95rem;
    line-height: 1.65;
}

.thesis-list {
    list-style: none;
    position: relative;
    padding-left: 38px;
    border-left: 1px solid var(--rr-line);
    margin-left: 6px;
}

.thesis-item {
    position: relative;
    margin-bottom: var(--space-md);
    color: var(--rr-mist);
    font-size: 0.95rem;
    line-height: 1.65;
}

.thesis-item:last-child { margin-bottom: 0; }

.thesis-number {
    position: absolute;
    left: -38px;
    top: -6px;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--rr-brass);
    opacity: 0.85;
    width: 30px;
    text-align: right;
}

.thesis-item strong {
    color: var(--rr-parchment);
    font-weight: 600;
}

.thesis-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--rr-line);
    text-align: center;
}

.thesis-footer p {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: var(--space-sm);
}

.thesis-footer .submit-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.thesis-footer .submit-btn:hover {
    background: var(--rr-parchment);
    color: var(--rr-ink);
    border-color: var(--rr-parchment);
}

/* --- FOOTER DESLIZANTE ("GAVETA") --- */
.site-footer {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(8, 9, 9, 0.88);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--rr-line);
    padding: var(--space-lg) var(--space-md) var(--space-md);
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.6s var(--ease-out);
}

.site-footer.active { transform: translateY(0); }

.footer-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    opacity: 0;
    transition: opacity 0.4s ease 0.2s;
}

.site-footer.active .footer-container { opacity: 1; }

.footer-nav {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-2xs);
}

.footer-link {
    position: relative;
    font-size: 0.78rem;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
    transition: color 0.3s ease;
    padding-bottom: 4px;
}

.footer-link::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 0%;
    height: 1px;
    background: var(--rr-brass);
    transition: width 0.35s var(--ease-out);
}

.footer-link:hover { color: var(--rr-brass); }
.footer-link:hover::after { width: 100%; }

.separator { color: #3a3a3a; font-size: 0.78rem; }

.legal-text {
    font-size: 0.66rem;
    color: #888;
    line-height: 1.6;
    max-width: 600px;
}

.copyright-text {
    font-size: 0.62rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    margin-top: var(--space-2xs);
}

.close-footer-hint {
    margin-top: var(--space-sm);
    color: #444;
    font-size: 1.1rem;
    cursor: pointer;
    animation: bounce 2.4s infinite;
}

/* --- KEYFRAMES --- */
@keyframes logoFadeIn {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes curtainUp {
    from { opacity: 1; visibility: visible; }
    to { opacity: 0; visibility: hidden; }
}
@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes frameReveal {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

/* --- MOVIMENTO REDUZIDO --- */
@media (prefers-reduced-motion: reduce) {
    .intro-overlay, .intro-logo, .hero-content, .cinematic-frame, .site-nav,
    .close-footer-hint, .modal-backdrop, .modal-content,
    .nav-link, .footer-link, .submit-btn, .form-input, .close-modal {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- RESPONSIVIDADE --- */
@media (min-width: 640px) {
    .modal-content--wide .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 0 var(--space-md);
    }
}

@media (max-width: 600px) {
    .cinematic-frame { display: none; }
}

@media (max-width: 900px) {
    .hero-content { padding-top: 0; }
    .logo-img { max-width: 220px; margin-bottom: var(--space-md); }
    .modal-content { padding: var(--space-lg) var(--space-md); }
}

/* Header: ainda cabe em uma linha em telas médias, só reduzido. */
@media (max-width: 640px) {
    .site-nav { padding: 22px 24px; }
    .nav-logo { height: 40px; }
    .nav-links { gap: 20px; }
    .nav-link { font-size: 11.5px; letter-spacing: 1.8px; }
}

@media (max-width: 600px) {
    .modal-content {
        padding: var(--space-lg) var(--space-sm); /* Reduz o espaçamento interno no mobile */
        max-height: 90vh; /* Ganha mais espaço vertical em telas pequenas */
    }
}

/* Header: em telas bem estreitas, a logo quebra para uma linha própria
   acima dos links — limpo e centralizado, em vez de espremido. */
@media (max-width: 480px) {
    .site-nav {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 14px;
        padding: 20px 16px;
    }
    .nav-logo { height: 36px; }
    .nav-links { gap: 22px; }
    .nav-link { font-size: 11px; letter-spacing: 1.6px; }
}

@media (max-width: 420px) {
    .eyebrow { letter-spacing: 0.22em; font-size: 0.64rem; }
    .modal-header p { max-width: 100%; }
}

/* --- SCROLLBAR DARK MODE --- */
::-webkit-scrollbar { width: 8px; background-color: var(--rr-ink); }
::-webkit-scrollbar-thumb {
    background-color: #2a2e2c;
    border-radius: 4px;
    border: 1px solid var(--rr-ink);
}
::-webkit-scrollbar-thumb:hover { background-color: var(--rr-forest); }

html {
    scrollbar-width: thin;
    scrollbar-color: #2a2e2c var(--rr-ink);
}
