:root {
    --bg: #05070a;
    --bg-soft: #0a1018;
    --panel: #101722;
    --panel-2: #141d2b;
    --line: rgba(255, 255, 255, 0.12);
    --text: #f4f7fb;
    --muted: #a9b4c2;
    --blue-primary: #007dff;
    --green-soundplan: #63b32e;
    --blue-soundplan: #0967b1;
    --danger: #ff7474;
    --success: #7fe09f;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --container: 1180px;
    --pad: clamp(1rem, 3vw, 2rem);
    --radius: 8px;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at 18% 18%, rgba(0, 125, 255, 0.14), transparent 28rem),
        radial-gradient(circle at 82% 26%, rgba(99, 179, 46, 0.12), transparent 25rem),
        var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid var(--green-soundplan);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: -6rem;
    left: 50%;
    z-index: 999;
    transform: translateX(-50%);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--blue-primary);
    color: #fff;
}

.skip-link:focus {
    top: 1rem;
}

.container {
    width: min(100% - (var(--pad) * 2), var(--container));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid transparent;
    background: rgba(5, 7, 10, 0.78);
    backdrop-filter: blur(18px);
}

.site-header.scrolled {
    border-bottom-color: var(--line);
}

/* 1fr auto 1fr mantém o menu opticamente centrado mesmo com a marca à esquerda;
   a terceira coluna fica vazia no desktop e recebe o hambúrguer no mobile. */
.header-inner {
    min-height: 88px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 1rem;
}

.header-brand img {
    width: auto;
    object-fit: contain;
}

.header-brand .brand-soundplan {
    height: 60px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 1.75rem;
    color: var(--muted);
    font-size: 0.94rem;
}

.desktop-nav a:hover {
    color: var(--text);
}

.btn {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.78rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--blue-primary);
    color: #fff;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 12px 32px rgba(0, 125, 255, 0.24);
}

.btn:hover {
    background: #1290ff;
}

.btn-small {
    min-height: 38px;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
}

.menu-toggle {
    display: none;
    justify-self: end;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: var(--text);
}

.mobile-nav {
    display: none;
}

.hero {
    min-height: calc(100vh - 88px);
    padding: clamp(2.5rem, 7vw, 6.5rem) 0 4rem;
}

/* Duas linhas para que o botão possa cair depois do mapa no mobile (order),
   sem sair da coluna de texto no desktop. */
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
    grid-template-rows: auto auto;
    column-gap: clamp(2rem, 6vw, 5rem);
    row-gap: 0;
    align-items: center;
}

/* o mapa ocupa as duas linhas e as estica; para o botão não ficar longe do
   texto, ancoramos o texto no fim da linha 1 e o botão no início da linha 2 —
   assim eles se encontram no centro, juntos. */
.hero-content {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
}

.hero-actions {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
}

.brazil-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.eyebrow {
    margin: 0 0 0.7rem;
    color: var(--green-soundplan);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 680px;
    margin-bottom: 1rem;
    font-size: clamp(2.75rem, 8vw, 5.85rem);
    line-height: 0.96;
}

.hero-copy {
    max-width: 650px;
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.25rem;
}

.brazil-panel {
    position: relative;
    min-height: clamp(430px, 68vw, 680px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(150deg, rgba(9, 103, 177, 0.16), transparent 42%),
        linear-gradient(25deg, rgba(99, 179, 46, 0.14), transparent 46%),
        rgba(16, 23, 34, 0.72);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.map-copy {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.72rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(5, 7, 10, 0.58);
}

.map-copy span {
    color: var(--muted);
    font-size: 0.85rem;
}

.map-copy strong {
    color: var(--green-soundplan);
    font-size: 1.2rem;
}

.panel-logo {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    height: 68px;
}

.panel-logo img {
    width: auto;
    height: 100%;
    object-fit: contain;
}

.brazil-viewport {
    position: absolute;
    inset: 4% 3% 1%;
    overflow: hidden;
    touch-action: none;
}

.brazil-map {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 30px 42px rgba(0, 0, 0, 0.34));
    cursor: grab;
}

.brazil-viewport.panning .brazil-map {
    cursor: grabbing;
}

.map-zoom {
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.zoom-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(5, 7, 10, 0.72);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    backdrop-filter: blur(6px);
}

.zoom-btn:hover {
    background: rgba(0, 125, 255, 0.28);
}

.zoom-reset {
    font-size: 1.05rem;
}

.brazil-map .br-state {
    fill: rgba(244, 247, 251, 0.08);
    stroke: rgba(244, 247, 251, 0.48);
    stroke-width: 1.25;
    vector-effect: non-scaling-stroke;
    transition: fill 180ms ease, stroke 180ms ease;
}

.brazil-map .br-state:hover {
    fill: rgba(0, 125, 255, 0.16);
    stroke: rgba(244, 247, 251, 0.75);
}

.map-point {
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: center;
}

.map-point:focus-visible {
    outline: none;
}

.map-point-pulse {
    fill: rgba(99, 179, 46, 0.24);
    animation: mapPulse 1.9s ease-out infinite;
}

.map-point-core {
    fill: var(--green-soundplan);
    stroke: #ffffff;
    stroke-width: 2;
    filter: drop-shadow(0 0 10px rgba(99, 179, 46, 0.85));
}

/* ponto agrupado (mais de um projeto no mesmo local): núcleo maior + número */
.map-point.is-cluster .map-point-core {
    r: 7;
}

.map-point-count {
    fill: #ffffff;
    font-size: 8px;
    font-weight: 800;
    pointer-events: none;
}

@keyframes mapPulse {
    to {
        transform: scale(2.4);
        opacity: 0;
    }
}

.project-popover {
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 8;
    width: min(330px, calc(100% - 2.5rem));
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(6, 10, 16, 0.94);
    box-shadow: var(--shadow);
}

.project-popover small {
    color: var(--green-soundplan);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.project-popover h2 {
    margin: 0.45rem 2rem 0.45rem 0;
    font-size: 1.2rem;
}

.project-popover p {
    color: var(--muted);
}

.popover-list {
    display: grid;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.popover-list a {
    display: grid;
    gap: 0.15rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 160ms ease, background 160ms ease;
}

.popover-list a:hover {
    border-color: rgba(99, 179, 46, 0.5);
    background: rgba(99, 179, 46, 0.08);
}

.popover-list strong {
    font-size: 0.98rem;
}

.popover-list span {
    color: var(--muted);
    font-size: 0.82rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popover-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.partners {
    padding: clamp(2.5rem, 5vw, 3.5rem) 0;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
}

.partners-title {
    margin-bottom: 1.75rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
}

/* A trilha tem duas cópias da lista; deslocar 50% reinicia no mesmo ponto. */
.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 48s linear infinite;
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track {
    animation-play-state: paused;
}

.marquee-group {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin: 0;
    padding: 0 1.25rem 0 0;
    list-style: none;
}

.partner-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 176px;
    height: 104px;
    padding: 0.9rem 1.1rem;
    color: var(--muted);
}

/* fallback textual (só quando a instituição não tem arquivo de logo) */
.partner-chip span {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
    color: #d3dae4;
}

/* logos recortados (sem a margem vazia do arquivo) e normalizados para tom
   claro; o nome aparece no title (hover). */
.partner-chip img {
    width: auto;
    max-width: 100%;
    max-height: 66px;
    object-fit: contain;
}

@keyframes marqueeScroll {
    to {
        transform: translateX(-50%);
    }
}

.source-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
}

.source-list li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(16, 23, 34, 0.7);
    color: var(--muted);
    font-size: 0.86rem;
}

.source-icon {
    width: 20px;
    height: 20px;
    flex: none;
    color: var(--green-soundplan);
}

/* Reveal ao rolar: as classes só entram via JS, então sem JS tudo fica visível. */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

.section {
    padding: clamp(4rem, 8vw, 6rem) 0;
    border-top: 1px solid var(--line);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 2rem;
}

.section h2 {
    max-width: 760px;
    margin-bottom: 0.9rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
}

.section p {
    color: var(--muted);
}

.project-list,
.method-grid {
    display: grid;
    gap: 1rem;
}

.project-card,
.method-card,
.contact-form {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(16, 23, 34, 0.74);
}

.project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem;
}

.project-card span {
    color: var(--green-soundplan);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-card h3 {
    margin: 0.25rem 0 0.4rem;
    font-size: 1.22rem;
}

.project-card p {
    margin-bottom: 0;
}

.text-link {
    flex: none;
    color: var(--text);
    font-weight: 800;
}

.text-link:hover {
    color: var(--green-soundplan);
}

.methodology {
    background: rgba(255, 255, 255, 0.025);
}

.split {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(2rem, 6vw, 4rem);
    align-items: start;
}

.method-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.method-card {
    padding: 1.15rem;
}

.method-card h3 {
    margin-bottom: 0.55rem;
    font-size: 1.1rem;
}

.method-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 0.82fr 1.18fr;
    gap: clamp(2rem, 6vw, 4rem);
}

.contact-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: clamp(1rem, 3vw, 1.5rem);
}

.contact-form label {
    display: grid;
    gap: 0.4rem;
    color: var(--text);
    font-weight: 700;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 0.85rem 0.9rem;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form .full,
.form-alert,
.hidden-field {
    grid-column: 1 / -1;
}

.hidden-field {
    position: absolute;
    left: -9999px;
}

.form-alert {
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius);
    font-weight: 700;
}

.form-alert.success {
    border: 1px solid rgba(127, 224, 159, 0.45);
    background: rgba(127, 224, 159, 0.12);
    color: var(--success);
}

.form-alert.error {
    border: 1px solid rgba(255, 116, 116, 0.45);
    background: rgba(255, 116, 116, 0.12);
    color: var(--danger);
}

.site-footer {
    padding: 3.5rem 0 1.5rem;
    border-top: 1px solid var(--line);
    background: #030508;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr 1fr;
    gap: 2rem;
}

.site-footer h2 {
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.site-footer p,
.site-footer a,
.footer-bottom {
    color: var(--muted);
}

.site-footer ul {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer a:hover {
    color: var(--text);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
}

.made-by {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--muted);
    transition: opacity 200ms ease;
}

.made-by:hover {
    opacity: 0.8;
}

.made-by img {
    height: 22px;
    width: auto;
}

@media (max-width: 980px) {
    /* sem o menu central, vira logo à esquerda e hambúrguer à direita */
    .header-inner {
        display: flex;
        justify-content: space-between;
    }

    .desktop-nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-nav {
        position: fixed;
        inset: 88px 0 auto;
        display: none;
        padding: 1rem var(--pad) 1.3rem;
        border-bottom: 1px solid var(--line);
        background: rgba(5, 7, 10, 0.98);
    }

    .mobile-nav.open {
        display: grid;
        gap: 0.8rem;
    }

    .mobile-nav a:not(.btn) {
        padding: 0.9rem 0;
        color: var(--muted);
    }

    .hero-grid,
    .split,
    .contact-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* No mobile o CTA vem depois do mapa do Brasil. */
    .hero-grid {
        grid-template-rows: none;
        row-gap: 2rem;
    }

    .hero-content,
    .hero-actions,
    .brazil-panel {
        grid-column: 1;
        grid-row: auto;
    }

    .hero-content {
        order: 1;
    }

    .brazil-panel {
        order: 2;
    }

    .hero-actions {
        order: 3;
        margin-top: 0;
    }

    .hero {
        padding-top: 2rem;
    }

    .brazil-panel {
        min-height: 540px;
    }

    .method-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .header-inner {
        min-height: 76px;
    }

    .mobile-nav {
        top: 76px;
    }

    .header-brand {
        gap: 0.7rem;
    }

    .header-brand .brand-soundplan {
        height: 48px;
    }

    .partner-chip {
        width: 140px;
        height: 88px;
        padding: 0.7rem 0.85rem;
    }

    .partner-chip img {
        max-height: 54px;
    }

    .partner-chip span {
        font-size: 0.92rem;
    }

    .marquee-group {
        gap: 1.25rem;
    }

    .hero-actions,
    .project-card {
        flex-direction: column;
        align-items: stretch;
    }

    /* rodapé centralizado no mobile: copyright acima, crédito abaixo, empilhado */
    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.4rem;
    }

    .made-by {
        flex-direction: column;
        gap: 0.55rem;
    }

    .made-by img {
        height: 26px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .brazil-panel {
        min-height: 450px;
    }

    .contact-form {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
