/* ARS.FILMS — portfolio */
:root {
  --bg: #0d0d0d;
  --bg-2: #151514;
  --ink: #f3efe8;
  --muted: #8f8a83;
  --line: rgba(243, 239, 232, .14);
  --coral: #ec8b8b;
  --pad: clamp(16px, 3.2vw, 44px);
  --gap: clamp(8px, 1vw, 14px);
  --head: 68px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--head); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.display {
  font-family: "Inter Tight", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  line-height: .88;
  letter-spacing: -.035em;
}
.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.dot {
  display: inline-block;
  width: .2em; height: .2em;
  margin-left: .08em;
  border-radius: 50%;
  background: var(--coral);
  vertical-align: baseline;
}

/* Film grain */
.grain {
  position: fixed; inset: -50%;
  z-index: 100; pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); } 60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); } 100% { transform: translate(0, 0); }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  height: 46px; padding: 0 22px;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  border-radius: 999px;
  transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease);
}
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--coral); }
.btn-line { border: 1px solid var(--line); }
.btn-line:hover { border-color: var(--ink); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 50;
  height: var(--head);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  background: rgba(13, 13, 13, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.scrolled { border-color: var(--line); }
.brand img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.nav a {
  font-family: "IBM Plex Mono", monospace; font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  transition: color .25s;
}
.nav a:hover { color: var(--ink); }
.nav .nav-cta { cursor: pointer; color: var(--ink); border: 1px solid var(--line); padding: 9px 16px; border-radius: 999px; }
.nav .nav-cta:hover { border-color: var(--coral); color: var(--coral); }

/* Intro */
.intro {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: clamp(28px, 6vh, 64px) var(--pad) clamp(20px, 3.5vh, 36px);
}
.intro-title {
  font-weight: 600; font-size: clamp(30px, 3.6vw, 56px);
  line-height: 1; letter-spacing: -.035em;
  opacity: 0; transform: translateY(14px); animation: tileIn 1s var(--ease) forwards;
}
.intro-title .dot { width: .16em; height: .16em; }
.intro-sub { color: var(--muted); padding-bottom: .4em; }

/* Filters */
.work { padding: 0 var(--pad) clamp(60px, 10vh, 120px); }
.filters {
  position: sticky; top: var(--head); z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; margin: 0 calc(var(--pad) * -1) clamp(14px, 2vw, 24px);
  padding-left: var(--pad); padding-right: var(--pad);
  background: rgba(13, 13, 13, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.filters-inner { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filters-inner::-webkit-scrollbar { display: none; }
.chip {
  flex: none; font-weight: 700; font-size: clamp(13px, 1.1vw, 15px);
  text-transform: uppercase; letter-spacing: .02em;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
  transition: color .25s, background .25s, border-color .25s;
}
.chip sup { font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 400; letter-spacing: .05em; margin-left: 2px; vertical-align: super; }
.chip:hover { color: var(--ink); border-color: rgba(243,239,232,.4); }
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters-hint { color: var(--muted); white-space: nowrap; }

/* Masonry grid */
.grid { display: flex; gap: var(--gap); align-items: flex-start; }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }

.tile {
  position: relative; display: block; width: 100%;
  text-align: left; border-radius: 4px; overflow: hidden;
  background: var(--bg-2);
  opacity: 0; transform: translateY(24px);
  animation: tileIn .8s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes tileIn { to { opacity: 1; transform: none; } }
.tile .media { position: relative; overflow: hidden; }
.tile .media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.92) brightness(.96);
  transition: transform 1s var(--ease), filter .6s;
}
.tile:hover .media img, .tile:focus-visible .media img { transform: scale(1.045); filter: saturate(1.05) brightness(1); }
.tile .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; opacity: 0; transition: opacity .6s; }
.tile .media video.on { opacity: 1; }
.tile .media iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  pointer-events: none; opacity: 0; transition: opacity .6s;
}
.tile .media iframe.on { opacity: 1; }
.tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,0) 40%);
  opacity: 0; transition: opacity .45s;
}
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.tile .meta {
  position: absolute; left: 12px; right: 12px; bottom: 11px; z-index: 2;
  display: grid; gap: 2px;
  opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .5s var(--ease);
}
.tile:hover .meta, .tile:focus-visible .meta { opacity: 1; transform: none; }
.tile .client { font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(243,239,232,.72); }
.tile .title { font-weight: 700; font-size: clamp(13px, 1.05vw, 15px); line-height: 1.2; text-transform: uppercase; }
.tile .badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px;
  background: rgba(13,13,13,.55); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .4s;
}
.tile:hover .badge, .tile:focus-visible .badge { opacity: 1; }
.tile.bw .media img { filter: grayscale(1) contrast(1.08) brightness(.92); }
.tile.bw:hover .media img { filter: grayscale(1) contrast(1.1) brightness(1); }
.tile .badge.star { background: var(--coral); color: var(--bg); }
.tile .play {
  position: absolute; top: 50%; left: 50%; z-index: 2;
  width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(243,239,232,.92); color: var(--bg); font-size: 16px; padding-left: 3px;
  opacity: 0; transform: scale(.7); transition: opacity .35s, transform .45s var(--ease);
}
.tile:hover .play { opacity: 1; transform: none; }
.tile.previewing .play { opacity: 0; }

/* Empty state */
.empty {
  min-height: 56vh; display: grid; place-content: center; justify-items: center; gap: 18px;
  text-align: center; border: 1px dashed var(--line); border-radius: 6px; padding: 48px 20px;
}
.empty .mono { color: var(--coral); }
.empty h2 { font-size: clamp(48px, 10vw, 150px); }
.empty p:not(.mono) { color: var(--muted); max-width: 46ch; }
.empty .btn { margin-top: 8px; }
.empty[hidden] { display: none; }

/* Botão fixo "Faça seu orçamento" — centralizado, com aro translúcido */
.fab {
  position: fixed; left: 50%; right: auto; translate: -50% 0;
  bottom: clamp(36px, 7vh, 64px); z-index: 150;
  height: 62px; padding: 0 34px; font-size: 14px; white-space: nowrap;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(12px);
  animation: tileIn .8s .6s var(--ease) forwards;
}
.fab::before {
  content: ""; position: absolute; inset: -8px; z-index: -1; border-radius: inherit;
  background: rgba(243, 239, 232, .12);
  border: 1px solid rgba(243, 239, 232, .35);
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  pointer-events: none;
}
.fab:hover { transform: translateY(-2px); }

/* Clients marquee */
.clients { border-top: 1px solid var(--line); overflow: hidden; padding: clamp(18px, 3vw, 34px) 0 clamp(120px, 17vh, 160px); }
.marquee-track {
  display: flex; align-items: center; gap: .5em; width: max-content; font-weight: 800; text-transform: uppercase;
  font-size: clamp(40px, 7vw, 110px); line-height: 1;
  animation: marquee 32s linear infinite;
}
.marquee-track span { color: transparent; -webkit-text-stroke: 1px rgba(243,239,232,.55); white-space: nowrap; transition: color .3s; }
.marquee-track span:hover { color: var(--ink); }
.marquee-track .dot { width: .16em; height: .16em; margin: 0; }
.clients:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Services */
.services { padding: clamp(60px, 12vh, 140px) var(--pad); }
.section-label { color: var(--muted); margin-bottom: 28px; }
.service-list { list-style: none; border-top: 1px solid var(--line); }
.service-list li { border-bottom: 1px solid var(--line); }
.service-list button {
  width: 100%; display: grid; align-items: center; text-align: left;
  grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 20px;
  padding: clamp(18px, 3vw, 34px) 0;
  transition: padding .5s var(--ease), color .3s;
}
.service-list .n { color: var(--muted); }
.s-name { font-size: clamp(36px, 6.4vw, 100px); transition: color .3s, font-weight .5s; }
.s-line { color: var(--muted); max-width: 40ch; }
.s-arrow { font-size: 26px; justify-self: end; transition: transform .5s var(--ease), color .3s; }
.service-list button:hover { padding-left: 14px; }
.service-list button:hover .s-name { color: var(--coral); font-weight: 200; font-style: italic; }
.service-list button:hover .s-arrow { transform: translateX(6px) rotate(-45deg); color: var(--coral); }

/* Contact */
.contact { padding: clamp(24px, 4vh, 48px) var(--pad) 0; }
.contact-title { font-size: clamp(64px, 15vw, 250px); }
.contact-title .dot { width: .17em; height: .17em; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(28px, 5vh, 52px); }
.contact-links .btn-big { height: 60px; padding: 0 32px; font-size: 14px; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 20px var(--pad) 0; overflow: hidden; }
.foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.foot-row a:hover { color: var(--ink); }
.foot-word {
  font-size: 13.4vw; line-height: .9; letter-spacing: -.03em;
  margin: clamp(24px, 5vw, 60px) 0 .04em calc(var(--pad) * -.2);
  white-space: nowrap; color: var(--ink);
}
.foot-word .dot { width: .17em; height: .17em; margin: 0 .04em; }

/* Lightbox */
.lb {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-columns: minmax(100px, 1fr) auto minmax(300px, 1fr); align-items: center;
  background: rgba(8, 8, 8, .96);
  backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .35s;
}
.lb[hidden] { display: none; }
.lb.open { opacity: 1; }
.lb-stage {
  --lbh: min(88svh, 900px);
  grid-column: 2; position: relative;
  height: var(--lbh); display: grid; place-items: center;
}
/* altura explícita: em grid, height:100% num <video> cai no tamanho original (1280px) e corta */
.lb-stage video, .lb-stage iframe {
  display: block; height: var(--lbh); width: auto; aspect-ratio: 9 / 16;
  max-width: 100vw; border: 0; border-radius: 6px; background: #000; object-fit: contain;
}
.lb-stage img { max-height: var(--lbh); max-width: min(calc(100vw - 440px), 1300px); object-fit: contain; border-radius: 4px; }
.lb-stage > * { animation: lbIn .55s var(--ease); }
@keyframes lbIn { from { opacity: 0; transform: scale(.97); } }
.lb-info { grid-column: 3; align-self: end; padding: 0 var(--pad) 8vh; display: grid; gap: 8px; max-width: 360px; }
.lb-count, .lb-cat { color: var(--muted); }
.lb-cat { color: var(--coral); }
.lb-client { font-size: clamp(26px, 2.6vw, 42px); }
.lb-title { color: rgba(243,239,232,.8); }
.lb-quote { margin-top: 14px; width: fit-content; }
.lb-btn { position: absolute; z-index: 3; transition: color .25s, background .25s; }
.lb-close { top: 20px; right: var(--pad); padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; }
.lb-close:hover { border-color: var(--coral); color: var(--coral); }
.lb-prev, .lb-next {
  top: 50%; width: 56px; height: 56px; margin-top: -28px; border-radius: 50%;
  border: 1px solid var(--line); font-size: 20px;
}
.lb-prev { left: var(--pad); }
.lb-next { right: var(--pad); }
.lb-prev:hover, .lb-next:hover { background: var(--ink); color: var(--bg); }

/* Responsive */
@media (max-width: 1000px) {
  .lb { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lb-stage { --lbh: min(76svh, 820px); grid-column: 1; }
  .lb-info { grid-column: 1; align-self: start; padding: 14px var(--pad) 20px; max-width: none; grid-template-columns: 1fr auto; }
  .lb-info .lb-client { font-size: 22px; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; margin: 0; width: 48px; height: 48px; }
  .lb-prev { left: auto; right: calc(var(--pad) + 56px); }
  .lb-info { padding-right: calc(var(--pad) + 120px); display: block; }
  .lb-info > * + * { margin-top: 4px; }
  .lb-stage img { max-width: 94vw; }
  .service-list button { grid-template-columns: 40px minmax(0, 1fr) 30px; }
  .s-line { grid-column: 2; grid-row: 2; }
  .s-arrow { grid-column: 3; grid-row: 1; }
}
@media (max-width: 640px) {
  :root { --head: 60px; }
  .brand img { height: 28px; }
  .intro { padding-top: 18px; padding-bottom: 16px; gap: 8px; }
  .intro-sub { font-size: 10px; }
  .filters { padding-top: 10px; padding-bottom: 10px; }
  .chip { padding: 8px 14px; }
  .nav a:not(.nav-cta) { display: none; }
  .filters-hint { display: none; }
  .tile .play { display: none; }
  .tile .title { font-size: 12px; }
  .tile .badge { font-size: 9px; padding: 4px 7px; }
  .fab { height: 54px; padding: 0 26px; font-size: 12px; bottom: clamp(28px, 5vh, 44px); }
}
@media (hover: none) {
  .filters-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .grain { display: none; }
}
