/* ========================
   VARIÁVEIS (cores e fontes)
   Mude aqui e o site inteiro acompanha
======================== */
:root {
    --bg: #0c0d0d;
    --text: #e8e8e5;
    --muted: #8b8e8c;
    --faint: #4a4d4c;
    --line: #1e2120;
    --accent: #9fc3c4;
    /* azul-água claro, usado só em foco e hover */

    --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Geist Mono', ui-monospace, Menlo, Consolas, monospace;

    /* margem lateral que respeita o notch do celular */
    --side-l: max(24px, env(safe-area-inset-left, 0px));
    --side-r: max(24px, env(safe-area-inset-right, 0px));

    color-scheme: dark;
}

/* ========================
   RESET E BASE
======================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}

/* ========================
   INTRO (tela de entrada)
   Só existe com a classe "intro" no <html>
======================== */
#intro {
    display: none;
}

.intro #intro {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

/* máscara: o nome sobe de dentro dela */
.intro-mask {
    display: block;
    overflow: hidden;
    padding-bottom: 20px;
}

.intro-mark {
    position: relative;
    display: block;
    font-size: clamp(2.75rem, 9vw, 6rem);
    font-weight: 300;
    letter-spacing: -0.05em;
    line-height: 1;
    animation: introUp 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

/* a linha que cresce embaixo do nome */
.intro-mark::after {
    content: '';
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -16px;
    height: 1px;
    background: var(--text);
    animation: introLine 1.4s cubic-bezier(0.8, 0, 0.2, 1) 0.3s forwards;
}

.intro-pct {
    position: absolute;
    right: var(--side-r);
    bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--faint);
    font-variant-numeric: tabular-nums;
}

.intro-pct span {
    color: var(--muted);
}

/* saída: a tela inteira sobe como uma cortina */
#intro.gone {
    pointer-events: none;
    animation: introOut 1s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

@keyframes introUp {
    from {
        transform: translateY(110%);
    }
}

@keyframes introLine {
    to {
        right: 0;
    }
}

@keyframes introOut {
    to {
        transform: translateY(-100%);
    }
}

/* enquanto a cortina sobe, o topo do site entra subindo, um depois do outro */
.intro:not(.revealed) nav,
.intro:not(.revealed) .hero > :not(.hero-video) {
    opacity: 0;
}

.intro.revealed .hero > :not(.hero-video) {
    animation: heroIn 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.intro.revealed .hero h1 {
    animation-delay: 0.35s;
}

.intro.revealed .hero-sub {
    animation-delay: 0.5s;
}

.intro.revealed .hero-meta {
    animation-delay: 0.6s;
}

.intro.revealed nav {
    animation: fadeIn 1s ease 0.7s backwards;
}

@keyframes heroIn {
    from {
        opacity: 0;
        transform: translateY(48px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
}

/* ========================
   NAVEGAÇÃO
======================== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    padding-bottom: 20px;
    padding-left: var(--side-l);
    padding-right: var(--side-r);
    transition: background-color 0.3s, border-color 0.3s;
    border-bottom: 1px solid transparent;
}

nav.scrolled {
    background-color: var(--bg);
    border-bottom-color: var(--line);
}

.nav-logo {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.85rem;
    transition: color 0.2s;
}

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

/* ========================
   HERO
======================== */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 160px;
    padding-bottom: 72px;
    padding-left: var(--side-l);
    padding-right: var(--side-r);
}

.hero h1 {
    font-size: clamp(3.5rem, 14vw, 10rem);
    font-weight: 300;
    letter-spacing: -0.05em;
    line-height: 0.9;
}

.hero-sub {
    margin-top: 28px;
    max-width: 30ch;
    font-size: 1.15rem;
    color: var(--muted);
}

.hero-meta {
    margin-top: 12px;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--faint);
}

/* topo com vídeo (HERO_VIDEO no main.js): tela cheia, texto embaixo */
.hero.has-video {
    position: relative;
    max-width: none;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 64px;
    /* o texto continua alinhado com o resto do site */
    padding-left: max(var(--side-l), calc((100% - 1200px) / 2 + 24px));
    padding-right: max(var(--side-r), calc((100% - 1200px) / 2 + 24px));
    overflow: hidden;
    /* o vídeo (z-index -1) fica atrás do texto, mas na frente do fundo da página */
    isolation: isolate;
}

.hero-video {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* escurece embaixo (texto) e em cima (menu) pra ficarem legíveis */
.hero.has-video::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to bottom, rgba(12, 13, 13, 0.6), transparent 20%),
        linear-gradient(to top, var(--bg) 0%, rgba(12, 13, 13, 0.4) 45%, rgba(12, 13, 13, 0.2) 100%);
}

.hero.has-video .hero-sub {
    color: var(--text);
}

.hero.has-video .hero-meta {
    color: var(--muted);
}

/* ========================
   SEÇÕES GERAIS
======================== */
section {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 72px;
    padding-bottom: 72px;
    padding-left: var(--side-l);
    padding-right: var(--side-r);
}

section h2 {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 40px;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px 32px;
    margin-bottom: 32px;
}

.section-head h2 {
    margin-bottom: 0;
}

/* ========================
   FILTROS
======================== */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.filter-btn {
    background: none;
    border: none;
    color: var(--faint);
    font-family: var(--sans);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.filter-btn:hover {
    color: var(--muted);
}

.filter-btn.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* ========================
   GALERIA (colunas estilo masonry, um card por trabalho)
======================== */
.grid {
    columns: 3;
    column-gap: 16px;
}

.work {
    break-inside: avoid;
    margin-bottom: 32px;
    cursor: pointer;
}

.work.hidden {
    display: none;
}

/* aparece ao rolar: começa invisível e mais baixo (o main.js coloca "in") */
.work.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.work.reveal.in {
    opacity: 1;
    transform: none;
}

.work-media {
    position: relative;
    overflow: hidden;
    background: var(--line);
}

/* a capa de onde a foto saiu fica vazia enquanto o lightbox está aberto */
.work.is-source .work-media {
    visibility: hidden;
}

.work-media img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.work:hover .work-media img {
    transform: scale(1.04);
}

/* prévia do vídeo: fica por cima da capa e só aparece quando começa a tocar */
.work-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s;
}

.work-preview.playing {
    opacity: 1;
}

/* selo no canto: quantas mídias ou duração do vídeo */
.work .tag {
    position: absolute;
    top: 10px;
    left: 10px;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 3px 7px;
}

.work-caption {
    padding-top: 12px;
}

.work-caption h3 {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    transition: color 0.2s;
}

.work-caption p {
    margin-top: 2px;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
}

.work:hover .work-caption h3 {
    color: var(--accent);
}

/* ========================
   QUEM JÁ ATENDEU (nomes passando em loop)
======================== */
.clients {
    display: flex;
    overflow: hidden;
    /* as pontas somem suavemente */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}

.clients ul {
    display: flex;
    flex-shrink: 0;
    list-style: none;
    animation: marquee 30s linear infinite;
}

.clients:hover ul {
    animation-play-state: paused;
}

.clients li {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    white-space: nowrap;
    color: var(--muted);
}

/* bolinha entre os nomes */
.clients li::after {
    content: '·';
    margin: 0 0.6em;
    color: var(--faint);
}

@keyframes marquee {
    to {
        transform: translateX(-100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .clients ul {
        animation: none;
    }
}

/* ========================
   BOTÃO FLUTUANTE DO WHATSAPP (só no celular)
======================== */
.wa-float {
    display: none;
}

@media (max-width: 768px) {
    .wa-float {
        display: grid;
        place-items: center;
        position: fixed;
        z-index: 90;
        right: var(--side-r);
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        width: 56px;
        height: 56px;
        border-radius: 50%;
        color: var(--bg);
        background: var(--text);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        opacity: 0;
        transform: translateY(16px) scale(0.9);
        pointer-events: none;
        transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .wa-float.visible {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
}

/* ========================
   SERVIÇOS
======================== */
.services {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}

.service {
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

.service h3 {
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.service p {
    color: var(--muted);
    max-width: 32ch;
}

.note {
    margin-top: 40px;
    font-size: 0.9rem;
    color: var(--faint);
}

/* ========================
   ORÇAMENTO (formulário)
======================== */
.lead {
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    max-width: 28ch;
    margin-bottom: 40px;
}

#form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 32px;
    max-width: 760px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.full {
    grid-column: 1 / -1;
}

label {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
}

input,
select,
textarea {
    width: 100%;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--faint);
    border-radius: 0;
    padding: 8px 0;
}

select option {
    background: var(--bg);
    color: var(--text);
}

input::placeholder,
textarea::placeholder {
    color: var(--faint);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

textarea {
    resize: vertical;
}

.form-error {
    color: var(--accent);
    font-size: 0.9rem;
    min-height: 1em;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
}

.btn {
    font: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--bg);
    background: var(--text);
    border: none;
    padding: 14px 24px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover {
    background: var(--accent);
}

.privacy {
    font-size: 0.8rem;
    color: var(--faint);
}

/* ========================
   LIGHTBOX (foto ampliada)
======================== */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    overflow: hidden;
    color: #fff;
    /* linhas: topo, foto (ocupa o resto), infos, miniaturas */
    grid-template-rows: auto minmax(0, 1fr) auto auto;
}

#lightbox.active {
    display: grid;
}

#lightbox:focus {
    outline: none;
}

/* com o lightbox aberto, a página de trás não rola */
body.no-scroll {
    overflow: hidden;
}

/* aparece ao abrir, some ao fechar */
.lb-fade {
    transition: opacity 0.35s;
}

#lightbox:not(.open) .lb-fade {
    opacity: 0;
}

/* mouse parado: controles somem e fica só a foto */
#lightbox.idle .lb-idle {
    opacity: 0;
    pointer-events: none;
}

#lightbox.idle {
    cursor: none;
}

/* com zoom, as infos saem da frente da foto */
#lightbox.zoomed .lightbox-info {
    opacity: 0;
}

/* uma foto só: sem setas nem miniaturas */
#lightbox.single .lightbox-nav,
#lightbox.single .lightbox-thumbs {
    display: none;
}

/* fundo: a própria foto desfocada, escurecida nas bordas */
.lightbox-ambient {
    position: absolute;
    inset: 0;
    background: #000;
    overflow: hidden;
}

.ambient-layer {
    position: absolute;
    inset: -10%;
    background-size: cover;
    background-position: center;
    filter: blur(60px) saturate(1.4);
}

.lightbox-ambient::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.8));
}

/* topo: contador e fechar */
.lightbox-top {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: 8px;
    padding-left: var(--side-l);
    padding-right: var(--side-r);
}

.lightbox-counter {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
}

.lightbox-counter b {
    font-weight: 400;
    color: #fff;
}

/* botões redondos de vidro fosco */
.lightbox-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.35s, transform 0.2s;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.lightbox-btn:active {
    transform: scale(0.92);
}

/* compartilhar + fechar, lado a lado */
.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-toast {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #fff;
    margin-right: 4px;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.lightbox-toast.show {
    opacity: 1;
    transform: none;
}

.lightbox-nav {
    position: absolute;
    z-index: 2;
    top: calc(50% - 22px);
}

#lightbox-prev {
    left: max(24px, env(safe-area-inset-left, 0px));
}

#lightbox-next {
    right: max(24px, env(safe-area-inset-right, 0px));
}

/* palco: área da foto, recebe arrastar, pinça e duplo clique */
.lightbox-stage {
    position: relative;
    z-index: 1;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#lightbox-media {
    position: absolute;
    inset: 8px 96px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#lightbox-media img,
#lightbox-media video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* as animações de abrir/fechar e o zoom contam a partir do canto */
    transform-origin: 0 0;
    -webkit-user-drag: none;
}

#lightbox-media .zoom-anim {
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#lightbox.zoomed .lightbox-stage {
    cursor: grab;
}

/* infos: categoria, local e título */
.lightbox-info {
    position: relative;
    z-index: 2;
    text-align: center;
    padding-top: 20px;
    padding-left: var(--side-l);
    padding-right: var(--side-r);
    pointer-events: none;
}

.lightbox-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 16px;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.lightbox-meta [hidden] {
    display: none;
}

.lightbox-category {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 3px 10px;
}

.lightbox-local {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lightbox-title {
    margin-top: 10px;
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* miniaturas */
.lightbox-thumbs {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-top: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    padding-left: var(--side-l);
    padding-right: var(--side-r);
    transition: opacity 0.35s;
}

.lightbox-thumbs::-webkit-scrollbar {
    display: none;
}

/* centraliza quando cabe, mas deixa rolar quando não cabe */
.thumb:first-child {
    margin-left: auto;
}

.thumb:last-child {
    margin-right: auto;
}

.thumb {
    flex: 0 0 auto;
    width: 44px;
    height: 56px;
    padding: 0;
    border: none;
    border-radius: 4px;
    overflow: hidden;
    background: none;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.2s, transform 0.2s;
}

.thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb:hover {
    opacity: 0.7;
}

.thumb {
    position: relative;
}

.thumb.is-video::after {
    content: '\25B6';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.6rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
}

.thumb.current {
    opacity: 1;
    transform: translateY(-4px);
}

/* tela estreita: menos margem pras setas, que ficam por cima da foto */
@media (max-width: 768px) {
    #lightbox-media {
        inset: 8px 16px;
    }
}

/* celular: sem setas (arrasta com o dedo) e foto de ponta a ponta */
@media (hover: none) {
    .lightbox-nav {
        display: none;
    }

    #lightbox-media {
        inset: 0;
    }
}

/* ========================
   FOOTER
======================== */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 32px;
    padding-bottom: 32px;
    padding-left: var(--side-l);
    padding-right: var(--side-r);
    border-top: 1px solid var(--line);
    color: var(--faint);
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ========================
   TABLET (até 768px)
======================== */
@media (max-width: 768px) {
    .grid {
        columns: 2;
    }

    .services {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .nav-links {
        gap: 20px;
    }

    .filters {
        gap: 8px 18px;
    }
}

/* ========================
   MOBILE (até 480px)
======================== */
@media (max-width: 480px) {
    :root {
        --side-l: max(16px, env(safe-area-inset-left, 0px));
        --side-r: max(16px, env(safe-area-inset-right, 0px));
    }

    .hero {
        padding-top: 120px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .grid {
        columns: 1;
    }

    #form {
        grid-template-columns: 1fr;
    }

    .thumb {
        width: 36px;
        height: 46px;
    }

    footer {
        flex-direction: column;
        text-align: center;
    }
}
