:root {
  --bg: #0b0b0c;
  --bg-alt: #121214;
  --line: #222226;
  --text: #f2f2f3;
  --muted: #8e8e93;
  --dim: #6e6e74;
  --accent: #e8c47c;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: #000; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: 1600px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--accent); color: #000; padding: 8px 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font: 500 15px var(--body); border: 1px solid var(--text);
  cursor: pointer; transition: transform .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: #3a3a3f; }
.btn-ghost:hover { color: #000; }
.btn-sm { padding: 9px 18px; font-size: 14px; }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  transition: background .3s, padding .3s;
}
.nav.scrolled { background: rgba(11,11,12,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding-block: 12px; border-bottom: 1px solid var(--line); }
.logo { font: 700 18px var(--display); letter-spacing: .12em; }
.logo span { color: var(--muted); margin-left: .35em; font-weight: 500; }
.menu { display: flex; align-items: center; gap: 32px; font-size: 15px; }
.menu a:not(.btn) { color: var(--muted); transition: color .2s; }
.menu a:not(.btn):hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 9px; right: 9px; height: 2px; background: var(--text); transition: transform .3s; }
.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { top: 23px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .menu {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; gap: 28px;
    background: var(--bg); font-size: 24px;
    opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  .menu.open { opacity: 1; pointer-events: auto; }
}

/* Hero */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding: 120px 0 clamp(60px, 10vh, 120px); overflow: hidden; }
.hero-media { position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 30%, #2a2420 0%, var(--bg) 70%); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .55; animation: zoom 20s ease-out both; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 5%, transparent 60%), linear-gradient(to right, rgba(11,11,12,.7), transparent 70%); }
@keyframes zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero-content { position: relative; width: 100%; }
.eyebrow { color: var(--muted); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 24px; }
.hero h1 { font-size: clamp(44px, 8.5vw, 124px); margin-bottom: 28px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { max-width: 520px; color: #c7c7cc; font-size: clamp(16px, 1.6vw, 19px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.scroll-cue { position: absolute; bottom: 28px; right: var(--gutter); width: 1px; height: 56px; background: linear-gradient(var(--muted), transparent); }

/* Sections */
.section { padding: clamp(80px, 12vw, 160px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); max-width: 640px; }
.section-head .num { display: block; font: 500 13px var(--display); color: var(--accent); letter-spacing: .1em; margin-bottom: 12px; }
.section-head h2 { font-size: clamp(34px, 5vw, 60px); margin-bottom: 14px; }
.section-head p { color: var(--muted); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filters button {
  font: 500 14px var(--body); color: var(--muted);
  background: transparent; border: 1px solid var(--line);
  padding: 8px 18px; border-radius: 999px; cursor: pointer; transition: all .2s;
}
.filters button:hover { color: var(--text); border-color: #444; }
.filters button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Gallery (masonry via columns) */
.gallery { columns: 3 320px; column-gap: 12px; }
.gallery figure {
  margin: 0 0 12px; break-inside: avoid; position: relative; overflow: hidden;
  border-radius: var(--radius); cursor: zoom-in; background: var(--bg-alt);
  opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s;
}
.gallery figure.in { opacity: 1; transform: none; }
.gallery figure.hide { display: none; }
.gallery img { width: 100%; transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .4s; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption {
  position: absolute; inset: auto 0 0; padding: 40px 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  font-size: 14px; display: flex; justify-content: space-between; gap: 12px;
  opacity: 0; transition: opacity .3s;
}
.gallery figcaption small { color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; align-self: center; }
.gallery figure:hover figcaption, .gallery figure:focus-visible figcaption { opacity: 1; }
.gallery figure:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: none) { .gallery figcaption { opacity: 1; } }
@media (max-width: 640px) {
  .gallery { columns: 2; column-gap: 8px; padding: 0 8px; }
  .gallery figure { margin-bottom: 8px; }
  .gallery figcaption { display: none; }
}

/* Placeholders (até ter fotos reais) */
.ph { background: linear-gradient(135deg, #1d1d21, #2a2622); position: relative; }
.ph::after { content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font: 500 13px var(--display); letter-spacing: .15em; text-transform: uppercase; }

/* Projects */
.project { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; margin-bottom: clamp(56px, 8vw, 100px); }
.project:last-child { margin-bottom: 0; }
.project-rev .project-img { order: 2; }
.project-img { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; }
.project-img img { width: 100%; height: 100%; object-fit: cover; }
.tag { color: var(--accent); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.project h3 { font-size: clamp(28px, 3.5vw, 42px); margin-bottom: 16px; }
.project-body > p:not(.tag) { color: #b5b5ba; }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; color: var(--muted); font-size: 15px; }
.ticks li::before { content: "—"; color: var(--accent); margin-right: 10px; }
@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; }
  .project-rev .project-img { order: 0; }
}

/* Services */
.services { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); border-top: 1px solid var(--line); counter-reset: s; }
.services li { padding: 32px 24px 32px 0; border-bottom: 1px solid var(--line); counter-increment: s; }
.services li::before { content: counter(s, decimal-leading-zero); font: 500 13px var(--display); color: var(--dim); display: block; margin-bottom: 18px; }
.services h3 { font-size: 22px; margin-bottom: 10px; }
.services p { color: var(--muted); font-size: 15px; margin: 0; }

/* About */
.about { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-img { aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden; position: sticky; top: 100px; }
.about-img img { width: 100%; height: 100%; object-fit: cover; }
.about > div > p { color: #b5b5ba; }
.process { list-style: none; padding: 0; margin: 40px 0 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; counter-reset: p; }
.process li { counter-increment: p; border-top: 1px solid var(--line); padding-top: 16px; }
.process b { display: block; font-family: var(--display); font-size: 18px; margin-bottom: 4px; }
.process b::before { content: counter(p, decimal-leading-zero) "  "; color: var(--accent); font-size: 13px; }
.process span { color: var(--muted); font-size: 14px; }
.gear { font-size: 13px; color: var(--dim); letter-spacing: .02em; }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-img { position: relative; top: 0; max-width: 420px; }
}
@media (max-width: 480px) { .process { grid-template-columns: 1fr; } }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); }
.contact h2 { font-size: clamp(34px, 5vw, 60px); margin-bottom: 20px; }
.contact-grid > div > p { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text) !important; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px rgba(52,199,89,.2); }
.links { display: grid; gap: 8px; margin-top: 32px; }
.links a { color: var(--text); border-bottom: 1px solid var(--line); padding-bottom: 8px; transition: color .2s; width: fit-content; }
.links a:hover { color: var(--accent); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.form .full { grid-column: 1 / -1; }
.form input, .form select, .form textarea {
  font: 400 16px var(--body); color: var(--text);
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; width: 100%; transition: border-color .2s;
}
.form textarea { resize: vertical; }
.form :focus { outline: none; border-color: var(--accent); }
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .form { grid-template-columns: 1fr; } }

/* Footer */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 32px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }

/* Lightbox */
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(5,5,6,.96); color: var(--text); }
.lightbox::backdrop { background: rgba(0,0,0,.9); }
.lightbox[open] { display: grid; place-items: center; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.lightbox figure { margin: 0; display: grid; gap: 12px; justify-items: center; padding: 56px 16px; }
.lightbox img { max-width: min(92vw, 1600px); max-height: 82vh; width: auto; object-fit: contain; }
.lightbox figcaption { color: var(--muted); font-size: 14px; }
.lightbox button { position: absolute; background: none; border: 0; color: var(--text); font-size: 40px; line-height: 1; cursor: pointer; padding: 16px; opacity: .7; transition: opacity .2s; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: 8px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

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

/* ===== Carrossel de portfólios (painéis expansíveis) ===== */
.pf-section { --pf-narrow: 230px; --pf-wide: min(620px, 52vw); --pf-gap: 24px; --pf-h: clamp(460px, 68vh, 640px); overflow: hidden; }
.pf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(32px, 5vw, 56px); }
.pf-head h2 { font-size: clamp(32px, 4.6vw, 64px); }
.pf-head h2 span { color: var(--accent); opacity: .85; }
.pf-arrows { display: flex; gap: 12px; flex-shrink: 0; }
.pf-arrows button {
  width: 60px; height: 60px; border-radius: 6px; border: 0; cursor: pointer;
  background: var(--accent); color: #111; font-size: 28px; line-height: 1;
  transition: transform .2s, filter .2s;
}
.pf-arrows button:hover { transform: translateY(-2px); filter: brightness(1.1); }
.pf-arrows button:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.pf-viewport { overflow: visible; }
.pf-track { display: flex; gap: var(--pf-gap); height: var(--pf-h); transition: transform .8s cubic-bezier(.65,0,.25,1); touch-action: pan-y; }

.pf-card {
  position: relative; flex: 0 0 var(--pf-narrow); height: 100%;
  border-radius: 8px; overflow: hidden; cursor: pointer;
  background: #141416; border: 0; padding: 0; color: inherit; text-align: left; font: inherit;
  transition: flex-basis .8s cubic-bezier(.65,0,.25,1);
}
.pf-card.active { flex-basis: var(--pf-wide); cursor: default; }
.pf-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.pf-card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(.7);
  transform: scale(1.06); transition: filter .8s, transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.pf-card.active img { filter: none; transform: scale(1); }
.pf-card:not(.active):hover img { filter: grayscale(.6) brightness(.85); }

/* tinta dourada nos fechados + degradê embaixo */
.pf-card::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(232,196,124,.18), rgba(11,11,12,.55) 55%, #0b0b0c);
  mix-blend-mode: normal; transition: opacity .8s;
}
.pf-card.active::before { background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.85)); }

.pf-mark { position: absolute; top: 18px; left: 20px; z-index: 2; font: 700 15px var(--display); color: var(--accent); letter-spacing: .1em; opacity: 0; transition: opacity .5s; }
.pf-card.active .pf-mark { opacity: 1; transition-delay: .4s; }

/* textos verticais (fechado) */
.pf-v { position: absolute; z-index: 2; left: 18px; writing-mode: vertical-rl; transform: rotate(180deg); color: var(--accent); font-size: 15px; white-space: nowrap; transition: opacity .4s; }
.pf-v-top { top: 36px; opacity: .85; }
.pf-v-bot { bottom: 36px; }
.pf-card.active .pf-v { opacity: 0; transition-delay: 0s; }
.pf-card:not(.active) .pf-v { transition-delay: .35s; }

/* conteúdo (aberto) */
.pf-body {
  position: absolute; z-index: 2; left: 28px; right: 28px; bottom: 28px;
  opacity: 0; transform: translateY(14px); transition: opacity .4s, transform .4s;
  pointer-events: none; min-width: 300px;
}
.pf-card.active .pf-body { opacity: 1; transform: none; transition: opacity .6s .45s, transform .6s .45s; pointer-events: auto; }
.pf-body h3 { font: 500 clamp(18px, 1.7vw, 24px)/1.25 var(--body); letter-spacing: -.01em; margin-bottom: 16px; }
.pf-body b { display: block; font-weight: 500; font-size: 16px; }
.pf-body small { display: block; color: var(--muted); font-size: 15px; margin-top: 4px; }
.pf-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pf-cta { flex-shrink: 0; font-size: 14px; color: #111; background: var(--accent); padding: 9px 16px; border-radius: 999px; transition: transform .2s; }
.pf-cta:hover { transform: translateY(-2px); }
.pf-progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); margin-top: 22px; overflow: hidden; }
.pf-progress i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.pf-card.active .pf-progress i { animation: pf-fill var(--pf-dur, 6s) linear forwards; }
.pf-section.paused .pf-card.active .pf-progress i { animation-play-state: paused; }
@keyframes pf-fill { to { transform: scaleX(1); } }

@media (max-width: 1100px) { .pf-section { --pf-narrow: 160px; --pf-wide: min(560px, 60vw); --pf-h: 560px; } }
@media (max-width: 640px) {
  .pf-section { --pf-narrow: 52px; --pf-wide: calc(100vw - 2 * var(--gutter) - 52px - var(--pf-gap)); --pf-gap: 10px; --pf-h: 520px; }
  .pf-arrows button { width: 46px; height: 46px; font-size: 22px; }
  .pf-head { align-items: center; }
  .pf-v { left: 14px; font-size: 13px; }
  .pf-v-bot { display: none; }
  .pf-body { left: 18px; right: 18px; bottom: 20px; min-width: 0; }
  .pf-row { flex-direction: column; align-items: flex-start; }
}
