/* ============================================================
   Portfólio — tema escuro editorial, moderno e dinâmico
   ============================================================ */

:root {
    --bg: #0a0a0a;
    --bg-soft: #141414;
    --fg: #f5f2ec;
    --muted: #a5a09a;
    --line: rgba(245, 242, 236, 0.14);
    --accent: #ff4d3d;
    --display: "Syne", system-ui, sans-serif;
    --body: "Inter", system-ui, -apple-system, sans-serif;
    --maxw: 1400px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #fff; }

/* ---- Textura de grão e barra de progresso ---- */
.grain {
    position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: var(--accent); z-index: 9999; transition: width 0.1s linear;
}

/* ---- Utilidades de layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px); }
.eyebrow {
    font-family: var(--body); font-size: 0.78rem; letter-spacing: 0.22em;
    text-transform: uppercase; color: var(--muted); font-weight: 600;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px clamp(20px, 5vw, 72px);
    mix-blend-mode: difference;
}
.topbar .brand {
    position: relative; display: inline-block;
    font-family: var(--display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em;
    line-height: 1.05; height: 1.05em;
    transition: height .7s cubic-bezier(0.22, 1, 0.36, 1);
}
.topbar .brand .b1 { display: block; }
.topbar .brand .b2 {
    position: absolute; top: 0; left: 0; white-space: nowrap;
    transform: translate(var(--b1w, 4.2em), 0);   /* estado topo: ao lado (uma linha) */
    transition: transform .7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}
/* Ao rolar a página, o nome desliza para duas linhas (à esquerda) */
.topbar.brand-stacked .brand { height: 2.1em; }
.topbar.brand-stacked .brand .b2 { transform: translate(0, 100%); }
.topbar nav { display: flex; gap: 26px; font-size: 0.85rem; font-weight: 500; }
.topbar nav a { position: relative; }
.topbar nav a::after {
    content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
    background: currentColor; transition: width 0.35s var(--ease);
}
.topbar nav a:hover::after { width: 100%; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: clamp(40px, 8vw, 90px) 0 clamp(30px, 5vw, 60px); }
.hero-grid {
    display: grid; grid-template-columns: 300px 1fr; gap: clamp(28px, 5vw, 64px);
    align-items: center;
}
.hero-photo {
    position: relative; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
    border: 1px solid var(--line); background: var(--bg-soft);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo .placeholder {
    display: flex; align-items: center; justify-content: center; height: 100%;
    font-family: var(--display); font-size: 4rem; font-weight: 800; color: var(--muted);
}
.hero-copy { min-width: 0; }
.hero-name {
    font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 0.92;
    font-size: var(--hero-name-size, clamp(2.6rem, 8vw, 6.4rem)); margin: 0.2em 0 0.15em;
}
.hero-role { font-size: clamp(1rem, 2.2vw, 1.4rem); color: var(--fg); font-weight: 500; }
.hero-role .dot { color: var(--accent); }
.hero-location { color: var(--muted); margin-top: 6px; font-size: 0.95rem; }
.hero-tagline {
    font-family: var(--display); font-weight: 600; font-size: clamp(1.2rem, 3vw, 2rem);
    line-height: 1.15; margin-top: 26px; max-width: 22ch;
}
.hero-bio { color: var(--muted); margin-top: 18px; max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.btn {
    display: inline-flex; align-items: center; gap: 10px; padding: 13px 26px;
    border-radius: 100px; border: 1px solid var(--line); font-weight: 600; font-size: 0.9rem;
    transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
    cursor: pointer; background: transparent; color: var(--fg);
}
.btn:hover { transform: translateY(-2px); }
.btn-solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost:hover { background: var(--fg); color: var(--bg); }

/* ---- Marquee de destaques ---- */
.marquee {
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    overflow: hidden; white-space: nowrap; margin-top: clamp(30px, 5vw, 56px);
}
.marquee-track { display: inline-flex; gap: 40px; padding: 16px 20px; animation: marquee 28s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
    font-family: var(--display); font-weight: 700; font-size: 1.15rem;
    text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted);
}
.marquee .star { color: var(--accent); margin-left: 40px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Topo enxuto (nome + cargo + frase, sem foto) */
.hero-lead { padding-bottom: clamp(18px, 3vw, 34px); }
.hero-lead .hero-tagline { max-width: 26ch; }

/* ============================================================
   SEÇÃO SOBRE
   ============================================================ */
.about { padding: clamp(50px, 8vw, 110px) 0; border-top: 1px solid var(--line); }
.about-layout {
    display: grid; grid-template-columns: 340px 1fr; gap: clamp(30px, 5vw, 70px);
    align-items: stretch; margin-top: 22px;
}
/* a coluna da foto estica até a altura do conteúdo, dando "trilho" para o sticky */
.about-photo-col { min-width: 0; }
.about-content { min-width: 0; }
.about-photo {
    position: sticky; top: 90px; aspect-ratio: 4 / 5; border-radius: 20px; overflow: hidden;
    border: 1px solid var(--line); background: var(--bg-soft);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo .placeholder {
    display: flex; align-items: center; justify-content: center; height: 100%;
    font-family: var(--display); font-weight: 800; font-size: 4rem; color: var(--muted);
}
.about-copy { min-width: 0; }
.about-bio {
    font-family: var(--display); font-weight: 600; font-size: clamp(1.2rem, 2.6vw, 1.9rem);
    line-height: 1.35; letter-spacing: -0.01em; max-width: 26ch; margin: 0 0 8px;
}
.about-block { margin-top: 24px; }
.about-block-heading {
    font-family: var(--display); font-weight: 700; font-size: clamp(1.3rem, 3vw, 2rem);
    letter-spacing: -0.02em; margin: 0 0 6px;
}
h3.about-block-heading { font-size: clamp(1.15rem, 2.6vw, 1.6rem); }
h4.about-block-heading { font-size: clamp(1rem, 2.2vw, 1.3rem); }
.about-block-text {
    font-size: clamp(1.02rem, 2vw, 1.2rem); line-height: 1.7; color: #c9c5bd;
    max-width: 62ch; white-space: pre-wrap; margin: 0;
}
.about-name {
    font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1;
    font-size: clamp(1.7rem, 3.5vw, 2.6rem); margin: 0 0 14px;
}

/* Blocos ricos: colunas via flex-wrap; largura vem do style inline (flex-basis) */
.about-blocks { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; margin-top: clamp(30px, 5vw, 56px); }
.about-blocks .about-block { flex-grow: 1; min-width: 0; margin: 0; }
.about-blocks .about-block .about-block-heading { margin-top: 0; }
.about-blocks .block-media, .about-blocks .block-embed { margin: 0; }
.about-blocks .block-media img, .about-blocks .block-media video { width: 100%; height: auto; display: block; }

@media (max-width: 760px) {
    .about-layout { grid-template-columns: 1fr; }
    .about-photo { position: static; width: 190px; aspect-ratio: 1; border-radius: 16px; }
    .about-blocks .about-block { flex-basis: 100% !important; max-width: 100% !important; }
}

/* ============================================================
   GRID DE PROJETOS
   ============================================================ */
.work { padding: clamp(50px, 8vw, 100px) 0; }
.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; margin-bottom: clamp(28px, 4vw, 48px);
}
.section-head h2 {
    font-family: var(--display); font-weight: 800; letter-spacing: -0.02em;
    font-size: clamp(1.8rem, 5vw, 3.4rem); margin: 0; line-height: 1;
}
.section-head .count { color: var(--muted); font-size: 0.9rem; }

.grid {
    display: grid; gap: clamp(14px, 1.6vw, 26px);
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
    position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden;
    background: var(--bg-soft); border: 1px solid var(--line);
    transition: transform 0.6s var(--ease), opacity 0.6s var(--ease), box-shadow 0.5s var(--ease);
    will-change: transform;
}
/* Só esconde para animar quando o JS está ativo (html.js). Sem JS, os cards ficam visíveis. */
html.js .card { opacity: 0; transform: translateY(28px); }
html.js .card.in { opacity: 1; transform: translateY(0); }
.card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(0,0,0,0.8); }
.card-cover { position: absolute; inset: 0; }
.card-cover img, .card-cover video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.card:hover .card-cover img, .card:hover .card-cover video { transform: scale(1.07); }
.card-cover .placeholder {
    display: flex; align-items: center; justify-content: center; height: 100%;
    font-family: var(--display); font-weight: 800; font-size: 2.4rem; color: var(--muted);
    background: radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,0.05), transparent);
}
.card-overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
    padding: 22px; z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
    opacity: 0; transform: translateY(10px); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.card:hover .card-overlay { opacity: 1; transform: translateY(0); }
.card-cat { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-local, var(--accent)); font-weight: 600; }
.card-title { font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.05; margin: 6px 0 2px; }
.card-client { color: var(--muted); font-size: 0.85rem; }
.card-index {
    position: absolute; top: 16px; left: 18px; z-index: 2; font-family: var(--display);
    font-weight: 800; font-size: 0.9rem; color: var(--fg); mix-blend-mode: difference;
}
.card-badge {
    position: absolute; top: 14px; right: 14px; z-index: 3; font-size: 0.68rem; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 10px; border-radius: 100px;
    background: var(--accent-local, var(--accent)); color: #fff;
}

.empty-work { text-align: center; padding: 80px 0; color: var(--muted); }

/* ============================================================
   PÁGINA DE PROJETO
   ============================================================ */
.proj-hero { padding: clamp(30px, 6vw, 70px) 0 clamp(20px, 3vw, 40px); }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; margin-bottom: 30px; }
.back-link:hover { color: var(--fg); }
.proj-title {
    font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 0.95;
    font-size: clamp(2.4rem, 8vw, 6rem); margin: 0.1em 0;
}
/* Palavras longas em títulos grandes quebram em vez de estourar a largura (mobile) */
.hero-name, .proj-title, .about-name, .footer-cta, .card-title,
.proj-nav .nm, .block-heading, .about-block-heading { overflow-wrap: break-word; }
.proj-meta { display: flex; flex-wrap: wrap; gap: 12px 34px; margin-top: 22px; color: var(--muted); }
.proj-meta .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; display: block; }
.proj-meta .v { color: var(--fg); font-weight: 500; }
.proj-summary { font-family: var(--display); font-weight: 600; font-size: clamp(1.2rem, 3vw, 1.8rem); line-height: 1.2; max-width: 32ch; margin-top: 28px; }
.accent-rule { height: 4px; width: 90px; background: var(--accent); border-radius: 4px; margin: 30px 0; }
.error-image { margin-top: clamp(28px, 5vw, 50px); max-width: 560px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.error-image img { width: 100%; height: auto; display: block; }

.blocks { padding-bottom: clamp(60px, 10vw, 120px); }
.block { margin: clamp(28px, 5vw, 56px) 0; }
.block-heading { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 4vw, 2.4rem); letter-spacing: -0.02em; max-width: 26ch; }
h3.block-heading { font-size: clamp(1.2rem, 3vw, 1.7rem); }
h4.block-heading { font-size: clamp(1.05rem, 2.4vw, 1.35rem); }
.block-text { font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.7; max-width: 62ch; color: #d9d5cd; white-space: pre-wrap; }
.block-media { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.block-media img, .block-media video { width: 100%; height: auto; }
.block-embed { position: relative; padding-top: 56.25%; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.block-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.block-caption { color: var(--muted); font-size: 0.9rem; margin-top: 10px; }

.proj-nav { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 36px 0; }
.proj-nav a { display: flex; flex-direction: column; gap: 4px; }
.proj-nav .lbl { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.proj-nav .nm { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.proj-nav .next { text-align: right; margin-left: auto; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); padding: clamp(50px, 8vw, 96px) 0 40px; }
.footer-cta { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 0.95; font-size: clamp(2rem, 8vw, 5.5rem); }
.footer-cta a { transition: color 0.3s; }
.footer-cta a:hover { color: var(--accent); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 30px; margin-top: 50px; }
.footer-col .eyebrow { margin-bottom: 12px; }
.footer-col a { display: block; color: var(--muted); padding: 3px 0; transition: color 0.25s; }
.footer-col a:hover { color: var(--fg); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 60px; color: var(--muted); font-size: 0.82rem; }
.footer-bottom .admin-link { opacity: 0.5; }
.footer-bottom .admin-link:hover { opacity: 1; color: var(--accent); }

/* ---- Responsivo ---- */
@media (max-width: 760px) {
    .hero-grid { grid-template-columns: 1fr; text-align: left; }
    .hero-photo { width: 150px; }
    .topbar { padding: 14px 20px; gap: 12px; }
    .topbar nav { gap: 15px; }
    /* No mobile o nome fica SEMPRE em duas linhas, à esquerda */
    .topbar .brand { height: 2.1em; }
    .topbar .brand .b2 { transform: translate(0, 100%); }
    /* Título da seção + contagem empilham (evita estouro horizontal no mobile) */
    .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    /* Títulos de projeto menores no celular (palavras longas cabem) */
    .proj-title { font-size: clamp(2rem, 9.5vw, 3.4rem); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .card { opacity: 1; transform: none; }
}
