:root {
  --bg: #ebe5f7;
  --paper: #f8f5ff;
  --ink: #251636;
  --muted: #6a5a81;
  --accent: #8c2cf3;
  --accent-strong: #7f20e7;
  --accent-dark: #5e15b8;
  --plum: #4f0b2c;
  --shadow: rgba(32, 13, 62, 0.26);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Barlow", sans-serif;
  background: radial-gradient(circle at 10% 0%, #f8f4ff 0%, var(--bg) 58%, #d7cff0 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(75, 35, 132, 0.09) 0.6px, transparent 0.6px);
  background-size: 4px 4px;
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: fixed;
  top: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, calc(100% - 2rem));
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(250, 246, 255, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(95, 49, 152, 0.24);
  border-radius: 10px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease, transform 0.26s ease;
}

body.nav-visible .topbar {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.brand {
  width: clamp(7.2rem, 16vw, 9.2rem);
  display: flex;
  align-items: center;
  position: relative;
}

.brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  -webkit-mask: url("../images/branding/Ativo_15Logos.png") center / contain no-repeat;
  mask: url("../images/branding/Ativo_15Logos.png") center / contain no-repeat;
  pointer-events: none;
}

.brand img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
}

.topbar nav {
  display: flex;
  gap: 1rem;
}

.topbar a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar a:hover {
  color: var(--accent-dark);
}

main,
footer {
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: end;
  padding: 8rem 1.5rem 3rem;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero.no-video {
  background: url("../images/frames/frame_0_0.50s.jpg") center / cover no-repeat;
}

.hero.no-video .hero-video {
  display: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(28, 11, 54, 0.77) 0%, rgba(16, 8, 36, 0.28) 46%, rgba(13, 4, 30, 0.46) 100%),
    linear-gradient(110deg, rgba(140, 44, 243, 0.5), transparent 36%);
}

.hero-content {
  max-width: 1120px;
  margin-inline: auto;
  width: 100%;
  color: #fff;
  position: relative;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo-panel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-inline: auto;
  width: min(96vw, 980px);
  padding: clamp(1.3rem, 2.8vw, 2.4rem) clamp(1.4rem, 4.5vw, 3.6rem);
  margin-bottom: 0;
  background: #8c2cf3;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
  clip-path: polygon(
    0% 8%,
    16% 3%,
    35% 7%,
    58% 2%,
    82% 7%,
    100% 3%,
    100% 92%,
    84% 98%,
    61% 94%,
    36% 99%,
    14% 94%,
    0% 98%
  );
  transition: clip-path 0.35s ease-out;
  will-change: clip-path;
  overflow: hidden;
}

.hero-logo-panel:hover,
.hero-logo-panel:focus-visible {
  animation: logoMorph 1.8s ease-in-out infinite alternate;
}

@keyframes logoMorph {
  0% {
    clip-path: polygon(0% 8%, 16% 3%, 35% 7%, 58% 2%, 82% 7%, 100% 3%, 100% 92%, 84% 98%, 61% 94%, 36% 99%, 14% 94%, 0% 98%);
  }

  25% {
    clip-path: polygon(0% 2%, 18% 11%, 38% 1%, 60% 9%, 83% 2%, 100% 12%, 100% 84%, 84% 96%, 61% 89%, 36% 97%, 14% 85%, 0% 92%);
  }

  50% {
    clip-path: polygon(0% 11%, 14% 2%, 34% 13%, 56% 3%, 79% 12%, 100% 4%, 100% 96%, 87% 85%, 64% 99%, 41% 88%, 18% 100%, 0% 89%);
  }

  75% {
    clip-path: polygon(0% 4%, 20% 14%, 40% 2%, 62% 13%, 84% 5%, 100% 14%, 100% 88%, 82% 100%, 60% 86%, 34% 96%, 12% 88%, 0% 100%);
  }

  100% {
    clip-path: polygon(0% 8%, 16% 3%, 35% 7%, 58% 2%, 82% 7%, 100% 3%, 100% 92%, 84% 98%, 61% 94%, 36% 99%, 14% 94%, 0% 98%);
  }
}

.hero-logo-panel img {
  width: clamp(21rem, 62vw, 58rem);
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.hero-content .btn-primary {
  margin-top: 1.2rem;
}

.lead {
  max-width: 64ch;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  margin-bottom: 1.5rem;
  margin-inline: auto;
}

.btn-primary,
.btn-light {
  display: inline-block;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.9rem 1.15rem;
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
}

.btn-light {
  background: #fff;
  color: var(--accent-dark);
}

.hero-ribbon {
  margin-inline: auto;
  margin-top: 2rem;
  width: min(1080px, 100%);
  padding: 1rem;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 55%, #b355ff 100%);
  color: #fff;
  font-family: "Anton", sans-serif;
  font-size: clamp(1rem, 2.8vw, 2rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  gap: 1.8rem;
  justify-content: center;
  transform: rotate(-2.2deg);
  clip-path: polygon(1% 3%, 7% 0, 19% 4%, 34% 0, 51% 6%, 71% 1%, 88% 5%, 98% 0, 100% 95%, 96% 100%, 81% 97%, 61% 100%, 41% 95%, 23% 100%, 11% 95%, 0 100%);
  box-shadow: 0 20px 35px var(--shadow);
}

.hero-ribbon span {
  min-width: 8.2ch;
  text-align: center;
}

.section {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
  padding: 5rem 0;
}

.section-head {
  margin-bottom: 2rem;
}

.section-head h2,
.services h2,
.contact h2 {
  font-family: "Anton", sans-serif;
  text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.92;
  margin-bottom: 0.6rem;
}

.section-head p {
  color: var(--muted);
  max-width: 60ch;
}

.projects {
  position: relative;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
}

.project-card {
  display: block;
  background: #fff;
  border: 1px solid rgba(78, 26, 132, 0.18);
  box-shadow: 0 14px 24px rgba(53, 18, 97, 0.1);
  overflow: hidden;
  border-radius: 8px;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-2px) scale(1.005);
  box-shadow: 0 18px 30px rgba(53, 18, 97, 0.16);
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

.project-info {
  display: none;
}

.services {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

.ribbon-panel {
  background: linear-gradient(150deg, var(--accent-dark) 0%, var(--accent) 45%, #ad4eff 100%);
  color: #fff;
  padding: 2.2rem;
  clip-path: polygon(0 5%, 3% 0, 17% 4%, 32% 0, 49% 5%, 64% 1%, 79% 4%, 94% 0, 100% 6%, 99% 94%, 96% 100%, 81% 96%, 65% 100%, 49% 96%, 33% 100%, 16% 96%, 3% 100%, 0 93%);
  box-shadow: 0 14px 24px var(--shadow);
}

.ribbon-panel ul {
  list-style: none;
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.stats div {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 1.1rem;
}

.stats strong {
  display: block;
  font-family: "Anton", sans-serif;
  font-size: 2.2rem;
  line-height: 0.9;
  color: var(--accent-dark);
}

.contact {
  text-align: center;
  background: linear-gradient(160deg, var(--plum) 0%, #6d1db6 50%, var(--accent) 100%);
  color: #fff;
  padding: 3.2rem 1.2rem;
  border-radius: 14px;
  box-shadow: 0 18px 36px var(--shadow);
}

.contact p {
  max-width: 65ch;
  margin: 0 auto 1.5rem;
  color: rgba(255, 255, 255, 0.88);
}

.contact-social {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.social-link {
  width: 3.1rem;
  height: 3.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--accent-dark);
  background: #fff;
  border-radius: 10px;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.social-link svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.social-link:hover,
.social-link:focus-visible {
  background: #efe3ff;
  color: #3d0f79;
  transform: translateY(-2px);
}

footer {
  width: min(1100px, calc(100% - 2rem));
  margin: 1rem auto 2.5rem;
  border-top: 1px solid rgba(114, 53, 176, 0.35);
  padding-top: 1rem;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .topbar {
    top: 0.6rem;
  }

  .topbar nav {
    gap: 0.5rem;
  }

  .topbar a {
    font-size: 0.76rem;
  }

  .brand {
    width: 6.2rem;
  }

  .hero {
    padding-top: 6.2rem;
  }

  .hero-logo-panel {
    width: min(96vw, 760px);
    padding: 0.95rem 1.15rem;
    margin-bottom: 0;
  }

  .hero-logo-panel img {
    width: clamp(14.5rem, 76vw, 30rem);
  }

  .hero-content .btn-primary {
    margin-top: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .services {
    grid-template-columns: 1fr;
  }

  .hero-ribbon {
    flex-wrap: wrap;
    transform: rotate(-1.2deg);
    justify-content: flex-start;
  }
}
