:root {
  --bg: #2A1FE0;
  --fg: #FFD6EA;
  --ink: #14123A;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 76rem;
  --sans: "Bricolage Grotesque", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.55;
  font-variation-settings: "opsz" 16;
  overflow-x: hidden;
  transition: background-color .7s ease, color .7s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--fg);
  color: var(--bg);
}
.skip:focus { top: 1rem; }

/* Buttons take the inverse of the current page colors */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .95rem 1.5rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 650;
  text-decoration: none;
  transition: transform .2s ease, background-color .7s ease, color .7s ease;
}
.btn:hover { transform: translateY(-2px) rotate(-1.5deg); }
.btn:active { transform: translateY(0) scale(.97); }
.btn--small { padding: .55rem 1rem; font-size: .95rem; }
.btn--big {
  padding: 1.3rem 2.4rem;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
}

/* Nav */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  background: var(--bg);
  transition: background-color .7s ease;
}
.nav__mark {
  font-weight: 800;
  font-variation-settings: "wdth" 80;
  font-size: 1.15rem;
  text-decoration: none;
}
.nav__links { display: flex; gap: 1.75rem; }
.nav__links a {
  text-decoration: none;
  font-size: .98rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .25s ease;
}
.nav__links a:hover { background-size: 100% 2px; }

@media (max-width: 760px) {
  .nav__links { display: none; }
}

/* Interactive background canvas sits behind everything */
.bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
main, .footer { position: relative; z-index: 1; }

/* Scroll reveals (classes added by script.js) */
.rv {
  opacity: 0;
  transform: translateY(1.1em);
  clip-path: inset(0 0 100% 0);
  transition:
    opacity .6s ease var(--d, 0s),
    transform .9s cubic-bezier(.2,.7,.2,1) var(--d, 0s),
    clip-path .9s cubic-bezier(.2,.7,.2,1) var(--d, 0s);
}
.rv.in {
  opacity: 1;
  transform: none;
  clip-path: inset(-30% -10% -30% -10%);
}
.badge.rv.in { transform: rotate(-3deg); }

/* Hero */
.hero {
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: 6rem var(--gutter) clamp(2rem, 5vw, 4rem);
}
.hero__name {
  display: flex;
  flex-direction: column;
  font-size: clamp(5.5rem, 27vw, 24rem);
  line-height: .8;
  letter-spacing: -.02em;
  font-weight: 300;
  font-variation-settings: "wdth" 75, "opsz" 96;
}
.hero__line { display: block; white-space: nowrap; }
.hero__line:nth-child(2) { padding-left: .55em; }
.hero__name .ch {
  display: inline-block;
  font-variation-settings: "wdth" 75, "opsz" 96, "wght" var(--w, 300);
  transition: font-variation-settings .35s cubic-bezier(.2,.7,.2,1);
}
.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}
.hero__lede {
  max-width: 34ch;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  line-height: 1.35;
}

@media (max-width: 600px) {
  .hero__line:nth-child(2) { padding-left: .25em; }
}

/* Projects intro */
.intro {
  padding: clamp(5rem, 12vw, 10rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  max-width: var(--max);
  margin: 0 auto;
}
.intro__title, .section-title, .contact__title {
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: .95;
  font-weight: 750;
  letter-spacing: -.025em;
  font-variation-settings: "wdth" 82, "opsz" 96;
  max-width: 14ch;
}
.intro__text {
  margin-top: 1.75rem;
  max-width: 56ch;
}

/* Project panels */
.project {
  min-height: 100svh;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}
.project--flip .project__text { order: 2; }
.project__text { display: grid; gap: 1rem; max-width: 46ch; }
.badge {
  justify-self: start;
  padding: .3rem .8rem;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  transform: rotate(-3deg);
}
.project__name {
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: .9;
  font-weight: 800;
  letter-spacing: -.03em;
  font-variation-settings: "wdth" 78, "opsz" 96;
}
.project__kind { font-size: 1.2rem; font-weight: 600; opacity: .85; }
.project__list {
  padding: 0;
  list-style: none;
  display: grid;
  gap: .35rem;
  margin-top: .25rem;
}
.project__list li::before { content: "+ "; font-weight: 800; }

@media (max-width: 860px) {
  .project {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: 4rem;
  }
  .project--flip .project__text { order: 0; }
}

/* Mockup frame — sizes scale with the frame width (cqi) */
.mock {
  container-type: inline-size;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 0 2px currentColor, 14px 14px 0 2px currentColor;
  --rot: 1.5deg;
  transform: translateY(var(--py, 0px)) rotate(calc(var(--rot) + var(--pr, 0deg))) scale(var(--sc, 1));
  transition: transform .3s ease-out;
}
.project--flip .mock { --rot: -1.5deg; }
.project:hover .mock { --rot: 0deg; --sc: 1.01; }
.mock__bar {
  display: flex;
  justify-content: center;
  padding: 2.2cqi;
  background: currentColor;
}
.mock__bar span {
  padding: .6cqi 3cqi;
  border-radius: 99px;
  background: var(--bg);
  font-size: 2.4cqi;
  transition: background-color .7s ease;
}
.mock__screen {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  padding: 5cqi 6cqi;
}

/* Dunna case: real screenshots in a browser frame + phone */
.mock--shot { margin: 0; }
.mock--shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
}
.case { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }

/* Screenshots open the real site */
.shot-link { display: block; position: relative; color: inherit; text-decoration: none; cursor: pointer; }
.shot-link img { transition: filter .3s ease; }
.shot-link:hover img, .shot-link:focus-visible img { filter: brightness(.6); }
.open-pill {
  position: absolute;
  left: 50%;
  top: 55%;
  z-index: 2;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.85);
  transition: opacity .25s ease, transform .3s cubic-bezier(.3,1.5,.5,1);
}
.shot-link:hover .open-pill,
.shot-link:focus-visible .open-pill { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* Touch screens have no hover: keep a small label visible */
@media (hover: none) {
  .open-pill {
    opacity: 1;
    top: auto;
    left: auto;
    right: .75rem;
    bottom: .75rem;
    padding: .45rem .9rem;
    font-size: .85rem;
    transform: none;
  }
}
.case__link { justify-self: start; margin-top: .5rem; }
.case__visual { position: relative; padding-bottom: 8%; }
.phone {
  position: absolute;
  right: -3%;
  bottom: -6%;
  width: 27%;
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 5px solid currentColor;
  box-shadow: 10px 10px 0 0 rgba(0,0,0,.35);
  transform: translateY(calc(var(--py, 0px) * -1.4)) rotate(4deg);
  transition: transform .3s ease-out;
}
.phone img { display: block; width: 100%; height: auto; }

.case-more {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.case-more__shot { --rot: -1.5deg; }
.case-more__text { display: grid; gap: 1.25rem; max-width: 46ch; }
.case-more__title {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1;
  font-weight: 750;
  letter-spacing: -.02em;
  font-variation-settings: "wdth" 82, "opsz" 72;
}
.decisions { display: grid; gap: 1rem; margin: .5rem 0 0; }
.decisions div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding-top: 1rem; border-top: 2px solid currentColor; }
.decisions dt { font-weight: 700; }
.decisions dd { margin: 0; }

/* Mirrored layouts for the second case */
.case.project--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
.project--flip .phone {
  right: auto;
  left: -3%;
  transform: translateY(calc(var(--py, 0px) * -1.4)) rotate(-4deg);
}
.case-more--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.case-more--flip .case-more__shot { order: 2; --rot: 1.5deg; }

@media (max-width: 860px) {
  .case, .case-more,
  .case.project--flip, .case-more--flip { grid-template-columns: 1fr; }
  .case-more--flip .case-more__shot { order: 0; }
  .project--flip .phone { left: 2%; }
  .case-more__shot { order: 0; }
  .phone { width: 32%; right: 2%; }
}

/* Builder — "Monte uma ideia do seu" */
.builder {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 9rem) var(--gutter);
}
.builder__head { display: grid; gap: 1.5rem; max-width: 56ch; }
.builder__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}
.builder__controls { display: grid; gap: 2rem; }
.field { display: grid; gap: .75rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label { padding: 0; font-weight: 700; font-size: 1.05rem; }
.field input[type="text"] {
  width: 100%;
  padding: .4rem 0;
  border: 0;
  border-bottom: 3px solid currentColor;
  background: transparent;
  color: inherit;
  font: 600 clamp(1.4rem, 3vw, 1.9rem) / 1.2 var(--sans);
}
.field input[type="text"]::placeholder { color: inherit; opacity: .4; }
.field input[type="text"]:focus-visible { outline: none; border-bottom-width: 5px; }

.chips, .swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.swatches { gap: .8rem; padding: 6px; }
.chips input, .swatches input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.chips span {
  display: inline-block;
  padding: .5rem 1rem;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.chips span:hover { transform: rotate(-2deg); }
.chips input:checked + span { background: var(--fg); color: var(--bg); }
.chips input:focus-visible + span,
.swatches input:focus-visible + span { outline: 3px solid currentColor; outline-offset: 3px; }

.swatches span {
  display: block;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.swatches span:hover { transform: scale(1.1); }
.swatches input:checked + span { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--fg); transform: scale(1.08); }

.builder__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border: 2px solid currentColor;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.mock--builder { position: sticky; top: 6rem; transform: rotate(-1deg); }

/* Live preview */
.pv {
  --pc: #E8332A;
  --pv-bg: var(--pc);
  --pv-ink: #FFF8F0;
  background: var(--pv-bg);
  color: var(--pv-ink);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2.4cqi;
  transition: background-color .4s ease, color .4s ease;
}
.pv > * { position: relative; }
.pv__nav { display: flex; gap: 4cqi; align-items: baseline; width: 100%; font-size: 2.5cqi; margin-bottom: 2cqi; }
.pv__nav b { margin-right: auto; font-size: 3.4cqi; }
.pv__title { max-width: 82%; font-size: 7cqi; line-height: 1; font-weight: 800; }
.pv__sub { max-width: 60%; font-size: 2.7cqi; line-height: 1.35; opacity: .85; }
.pv__cta { padding: 1.5cqi 4cqi; background: var(--pv-ink); color: var(--pv-bg); font-size: 2.7cqi; font-weight: 700; transition: inherit; }
.pv__shape {
  position: absolute !important;
  right: -8cqi;
  bottom: -14cqi;
  width: 46cqi;
  height: 46cqi;
  background: var(--pv-ink);
  opacity: .16;
  transition: border-radius .5s ease, transform .5s ease;
}
.pv.is-swapping .pv__title,
.pv.is-swapping .pv__sub { animation: pv-in .45s cubic-bezier(.2,.7,.2,1); }
@keyframes pv-in { from { opacity: 0; transform: translateY(2cqi); } }

.pv[data-style="ousado"] { font-family: var(--sans); }
.pv[data-style="ousado"] .pv__title { font-family: "Anton", sans-serif; font-weight: 400; font-size: 8.4cqi; text-transform: uppercase; line-height: .95; }
.pv[data-style="ousado"] .pv__shape { border-radius: 0; transform: rotate(18deg); }

.pv[data-style="elegante"] { --pv-bg: #F7F6FB; --pv-ink: var(--pc); font-family: "Fraunces", serif; align-items: center; text-align: center; }
.pv[data-style="elegante"] .pv__title { font-weight: 400; font-style: italic; }
.pv[data-style="elegante"] .pv__sub { font-family: var(--sans); }
.pv[data-style="elegante"] .pv__cta { background: transparent; color: var(--pc); border: .3cqi solid var(--pc); font-family: var(--sans); font-weight: 600; }
.pv[data-style="elegante"] .pv__shape { width: 70cqi; height: 70cqi; left: 50%; right: auto; bottom: -52cqi; margin-left: -35cqi; border-radius: 50%; opacity: .08; }

.pv[data-style="divertido"] { --pv-bg: color-mix(in srgb, var(--pc) 22%, #fff); --pv-ink: color-mix(in srgb, var(--pc) 70%, #000); font-family: "Baloo 2", sans-serif; }
.pv[data-style="divertido"] .pv__title { font-size: 7.6cqi; line-height: .95; }
.pv[data-style="divertido"] .pv__cta { border-radius: 99px; transform: rotate(-3deg); background: var(--pc); color: #fff; }
.pv[data-style="divertido"] .pv__shape { background: var(--pc); opacity: .55; border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; animation: wobble 7s ease-in-out infinite; }
@keyframes wobble { 50% { transform: rotate(25deg) scale(1.08); border-radius: 58% 42% 37% 63% / 55% 40% 60% 45%; } }

@media (max-width: 860px) {
  .builder__grid { grid-template-columns: 1fr; }
  .mock--builder { order: -1; position: relative; top: auto; transform: none; }
}

/* Services */
.services, .process, .about {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 9rem) var(--gutter);
}
.services__list { margin-top: clamp(2rem, 5vw, 4rem); }
.service {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 3rem;
  padding: 2rem 0;
}
.service::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: currentColor;
  transform: scaleX(var(--line, 1));
  transform-origin: left;
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1) var(--d, 0s);
}
.service.line { --line: 0; }
.service.line.in { --line: 1; }
.service h3 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 700;
  font-variation-settings: "wdth" 85, "opsz" 72;
}
.service p { max-width: 44ch; }
@media (max-width: 700px) {
  .service { grid-template-columns: 1fr; }
}

/* Process */
.steps {
  list-style: none;
  padding: 0;
  margin-top: clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
}
.steps h3 { font-size: 1.6rem; font-weight: 700; margin: .5rem 0; }
.steps__n {
  display: block;
  font-size: clamp(5rem, 10vw, 8rem);
  line-height: .8;
  font-weight: 200;
  font-variation-settings: "wdth" 75, "opsz" 96;
}
@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
}

/* About */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 2rem 4rem;
  align-items: start;
}
.about__text { display: grid; gap: 1.25rem; max-width: 58ch; font-size: clamp(1.15rem, 1.8vw, 1.35rem); }
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
}

/* Contact */
.contact {
  min-height: 90svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  padding: clamp(5rem, 12vw, 9rem) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}
.contact__title { font-size: clamp(3.5rem, 13vw, 11rem); max-width: 8ch; }
.contact__text { max-width: 40ch; font-size: clamp(1.15rem, 2vw, 1.4rem); }

.footer {
  padding: 2rem var(--gutter);
  font-size: .9rem;
  max-width: var(--max);
  margin: 0 auto;
}

/* Mini preview while filling the builder on small screens */
.pv-mini {
  position: fixed;
  left: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 60;
  width: min(52vw, 15rem);
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(120%) rotate(-3deg);
  transition: transform .4s cubic-bezier(.3,1.4,.5,1), opacity .25s ease;
}
.pv-mini.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) rotate(-3deg);
}
.pv-mini .mock {
  position: static;
  transform: none;
  border-radius: 10px;
  box-shadow: 0 0 0 2px currentColor, 6px 6px 0 2px currentColor;
}
@media (min-width: 861px) {
  .pv-mini { display: none; }
}

/* Floating WhatsApp */
.float {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 60;
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: #25D366;
  color: #0B3B1F;
  box-shadow: 0 0 0 3px var(--fg);
  transform: scale(0);
  transition: transform .35s cubic-bezier(.3,1.6,.5,1), box-shadow .7s ease;
}
.float.is-visible { transform: scale(1); }
.float.is-visible:hover { transform: scale(1.08) rotate(-8deg); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; clip-path: none; }
  .service.line { --line: 1; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
