:root {
  --bg: #0a0a0a;
  --bg-2: #141414;
  --fg: #ffffff;
  --muted: #9a9a9a;
  --line: #262626;
  --light-bg: #ffffff;
  --light-fg: #0a0a0a;
  --light-muted: #555555;
  --light-line: #e5e5e5;
  --wa: #25D366;
  --wa-dark: #1ebe5a;
  --radius: 14px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

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

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: rgba(10, 10, 10, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav__brand img { height: 26px; width: auto; }
.nav__menu { display: flex; gap: 32px; }
.nav__menu a {
  text-decoration: none; font-size: 15px; font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); transition: color .2s;
}
.nav__menu a:hover { color: var(--fg); }
.nav__toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  font-family: inherit; font-size: 16px; font-weight: 700; text-decoration: none;
  transition: transform .15s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 22px; height: 22px; }
.btn--wa { background: var(--wa); color: #06210f; }
.btn--wa:hover { background: var(--wa-dark); }
.btn--ghost { border: 1px solid #3a3a3a; color: var(--fg); }
.btn--ghost:hover { border-color: var(--fg); }
.btn--lg { padding: 18px 32px; font-size: 20px; }
.btn--lg svg { width: 26px; height: 26px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; padding: 110px 0 80px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 50% 35%, #1c1c1c 0%, var(--bg) 65%);
}
.hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero__title {
  margin: 28px 0 12px; font-size: clamp(30px, 6vw, 60px); line-height: 1.05;
  letter-spacing: -.02em; font-weight: 700;
}
.hero__lead { max-width: 560px; margin: 0 0 36px; color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.hero__scroll {
  position: absolute; left: 50%; bottom: 28px; width: 24px; height: 40px; margin-left: -12px;
  border: 2px solid #444; border-radius: 12px;
}
.hero__scroll::after {
  content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  background: var(--fg); border-radius: 2px; animation: scroll 1.6s infinite;
}
@keyframes scroll { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- Glitch (logo) ---------- */
.glitch { position: relative; width: min(383px, 82vw); }
.glitch img { width: 100%; }
.glitch img + img { position: absolute; inset: 0; opacity: 0; }
.glitch img:nth-child(2) { animation: glitch-a 4s infinite steps(1); }
.glitch img:nth-child(3) { animation: glitch-b 4s infinite steps(1); }

@keyframes glitch-a {
  0%, 86%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  87% { opacity: .9; transform: translateX(-10px); clip-path: inset(18% 0 58% 0); }
  89% { opacity: .9; transform: translateX(8px);  clip-path: inset(60% 0 12% 0); }
  91% { opacity: .9; transform: translateX(-5px); clip-path: inset(38% 0 40% 0); }
  93% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 87%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  88% { opacity: .7; transform: translateX(12px); clip-path: inset(48% 0 30% 0); }
  90% { opacity: .7; transform: translateX(-9px); clip-path: inset(8% 0 70% 0); }
  92% { opacity: 0; }
}

/* Títulos: glitch no hover */
.section__title, .contact__title { position: relative; display: inline-block; }
.section__title::before, .section__title::after,
.contact__title::before, .contact__title::after {
  content: attr(data-text); content: attr(data-text) / ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
}
.section__title:hover::before, .contact__title:hover::before { opacity: .8; animation: title-a .35s steps(2) 2; }
.section__title:hover::after, .contact__title:hover::after { opacity: .5; animation: title-b .35s steps(2) 2; }
@keyframes title-a { 0% { transform: translateX(-4px); clip-path: inset(10% 0 55% 0); } 100% { transform: translateX(3px); clip-path: inset(55% 0 10% 0); } }
@keyframes title-b { 0% { transform: translateX(4px); clip-path: inset(60% 0 5% 0); } 100% { transform: translateX(-3px); clip-path: inset(5% 0 60% 0); } }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section--light { background: var(--light-bg); color: var(--light-fg); }
.eyebrow {
  margin: 0 0 8px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.section--light .eyebrow { color: var(--light-muted); }
.section__title { margin: 0 0 48px; font-size: clamp(36px, 6vw, 64px); line-height: 1; letter-spacing: -.03em; }

/* Serviços */
.container--wide { max-width: 1280px; }
.section__lead { max-width: 620px; margin: -28px 0 48px; font-size: 19px; color: var(--light-muted); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: stretch; }
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 28px 24px 24px; border: 1px solid var(--light-line); border-radius: var(--radius);
  background: #fafafa;
  transition: background .3s, color .3s, transform .3s, box-shadow .3s, border-color .3s;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--light-fg) 0 60%, var(--wa) 60% 100%);
  transform: scaleX(.18); transform-origin: left; transition: transform .45s;
}
.card:hover, .card:focus-within {
  background: var(--light-fg); color: var(--light-bg); border-color: var(--light-fg);
  transform: translateY(-6px); box-shadow: 0 24px 48px rgba(0, 0, 0, .18);
}
.card:hover::before, .card:focus-within::before { transform: scaleX(1); background: linear-gradient(90deg, #fff 0 60%, var(--wa) 60% 100%); }
.card__icon { display: block; color: var(--light-fg); transition: color .3s; }
.card__icon svg {
  display: block; width: 32px; height: 32px;
  filter: drop-shadow(-2px 0 0 rgba(0, 0, 0, .18)) drop-shadow(2px 0 0 rgba(37, 211, 102, .45));
}
.card:hover .card__icon, .card:focus-within .card__icon { color: var(--light-bg); }
.card:hover .card__icon svg, .card:focus-within .card__icon svg {
  filter: drop-shadow(-2px 0 0 rgba(255, 255, 255, .3)) drop-shadow(2px 0 0 rgba(37, 211, 102, .7));
}
.card h3 { margin: 16px 0 2px; font-size: 21px; line-height: 1.2; letter-spacing: -.01em; }
.card p { margin: 0 0 12px; color: var(--light-muted); font-size: 15px; line-height: 1.55; }
.card p strong { color: var(--light-fg); }
.card .card__aka { margin-bottom: 14px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.card__aka em { font-style: normal; font-weight: 700; color: var(--light-fg); }
.card .card__tagline { font-size: 15.5px; font-weight: 700; line-height: 1.4; color: var(--light-fg); }
.card .card__desc { margin-bottom: 16px; }

.card__foot { margin-top: auto; }
.card__more { margin: 0 0 20px; border-top: 1px solid var(--light-line); }
.card__more summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0 0; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 700; color: var(--light-fg);
}
.card__more summary::-webkit-details-marker { display: none; }
.card__more summary::after { content: "+"; font-size: 20px; line-height: 1; transition: transform .25s; }
.card__more[open] summary::after { transform: rotate(45deg); }
.card__more[open] summary { padding-bottom: 12px; }
.card .card__ideal { padding: 10px 12px; border-radius: 10px; background: #efefef; font-size: 14px; }
.card__list { list-style: none; margin: 0; padding: 0; }
.card__list li { position: relative; padding: 6px 0 6px 24px; font-size: 14px; line-height: 1.45; border-top: 1px dashed var(--light-line); }
.card__list li::before {
  content: ""; position: absolute; left: 2px; top: 11px; width: 11px; height: 6px;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
}
.card__cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--light-fg);
  font-weight: 700; font-size: 14px; text-decoration: none; color: var(--light-fg);
  transition: background .2s, color .2s, gap .2s, border-color .2s;
}
.card__cta:hover { gap: 12px; }
.card:hover .card__cta, .card:focus-within .card__cta { background: var(--wa); border-color: var(--wa); color: #06210f; }
.card:hover p, .card:focus-within p { color: #c9c9c9; }
.card:hover p strong, .card:focus-within p strong,
.card:hover .card__tagline, .card:focus-within .card__tagline,
.card:hover .card__aka em, .card:focus-within .card__aka em,
.card:hover .card__more summary, .card:focus-within .card__more summary { color: var(--light-bg); }
.card:hover .card__more, .card:focus-within .card__more { border-top-color: #333; }
.card:hover .card__ideal, .card:focus-within .card__ideal { background: #1d1d1d; }
.card:hover .card__list li, .card:focus-within .card__list li { border-top-color: #333; }

@media (max-width: 1180px) { .cards { grid-template-columns: repeat(2, 1fr); } }

.card__hint, .card__mini { display: none; }

/* Computador com mouse: o card mostra só ícone + nome; a descrição aparece ao passar o mouse */
@media (hover: hover) and (min-width: 861px) {
  .card { min-height: 550px; padding: 0; }
  .card__face, .card__body {
    position: absolute; inset: 0; padding: 30px 24px 24px;
    transition: opacity .35s, transform .35s;
  }
  .card__face {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  }
  .card__face .card__icon svg { width: 48px; height: 48px; }
  .card__face h3 { margin-top: 22px; font-size: 23px; }
  .card__face .card__aka { margin-bottom: 0; }
  .card__hint {
    display: block; position: absolute; left: 0; right: 0; bottom: 24px;
    font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--light-muted);
  }
  .card__hint::before { content: "↓ "; }
  .card__body {
    display: flex; flex-direction: column; overflow: auto;
    opacity: 0; transform: translateY(18px); pointer-events: none;
  }
  .card__mini {
    display: block; margin: 0 0 10px !important;
    font-size: 12px !important; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--wa) !important;
  }
  .card__foot { margin-top: auto; }
  .card__more { margin-bottom: 16px; border-top: 0; }
  .card__more summary, .card .card__ideal { display: none; }
  .card__list li { padding: 5px 0 5px 22px; font-size: 13.5px; }
  .card__list li::before { top: 10px; }
  .card__list li:nth-child(n+5) { display: none; }
  .card .card__desc { margin-bottom: 12px; font-size: 14.5px; }
  .card__cta { align-self: stretch; justify-content: center; }

  .card:hover .card__face, .card:focus-within .card__face { opacity: 0; transform: translateY(-18px); }
  .card:hover .card__body, .card:focus-within .card__body { opacity: 1; transform: none; pointer-events: auto; }
}

/* Portfólio */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.case {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .25s, transform .25s;
}
.case:hover { border-color: #555; transform: translateY(-4px); }
.case a { text-decoration: none; display: block; }
.case__shot { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: #1a1a1a; }
.case__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: grayscale(1); transition: filter .4s, transform .6s; }
.case:hover .case__shot img { filter: none; transform: scale(1.03); }
.case__body { padding: 20px 24px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.case__body h3 { margin: 0; font-size: 20px; }
.case__body p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.case__arrow { font-size: 22px; transition: transform .25s; }
.case:hover .case__arrow { transform: translate(3px, -3px); }

/* Sobre */
.about { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; }
.about__text p { margin: 0 0 18px; font-size: 19px; }
.about__list { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--light-line); }
.about__list li { padding: 16px 0; border-bottom: 1px solid var(--light-line); color: var(--light-muted); }
.about__list strong { color: var(--light-fg); }

/* Contato */
.contact {
  text-align: center;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px), var(--bg);
}
.contact__inner { display: flex; flex-direction: column; align-items: center; }
.contact__title { margin: 0 0 16px; font-size: clamp(32px, 6vw, 60px); line-height: 1.05; letter-spacing: -.03em; max-width: 820px; }
.contact__lead { margin: 0 0 36px; color: var(--muted); }

/* Rodapé */
.footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer img { height: 24px; width: auto; }
.footer p { margin: 0; color: var(--muted); font-size: 14px; }

/* WhatsApp flutuante */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wa); color: #fff;
  box-shadow: 0 8px 24px rgba(37, 211, 102, .35);
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 32px; height: 32px; }

:focus-visible { outline: 2px solid var(--wa); outline-offset: 3px; }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
  .section__lead { margin: -16px 0 32px; font-size: 17px; }
  .grid { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 8px; }
  .section { padding: 80px 0; }
  .section__title { margin-bottom: 32px; }

  .nav__toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer;
  }
  .nav__toggle span { display: block; height: 2px; background: var(--fg); transition: transform .25s; }
  .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); }
  .nav__menu {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 20px 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a { padding: 14px 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .btn { width: 100%; justify-content: center; }
  .btn--lg { font-size: 18px; padding: 16px 20px; }
  .footer__inner { flex-direction: column; text-align: center; }
  .hero__scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .glitch img + img { display: none; }
}
