/* Home: revisão de UX/UI. Regras próprias da home; styles.css segue compartilhado. */

/* Progresso de leitura e seção ativa no menu */
.home-page .read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--coral);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  pointer-events: none;
}

.home-page .nav a {
  white-space: nowrap;
}

.home-page .nav a:not(.nav-cta) {
  position: relative;
  padding: 8px 0;
  transition: color .2s ease;
}

.home-page .nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.home-page .nav a[aria-current="true"]:not(.nav-cta) {
  color: var(--ink);
}

.home-page .nav a[aria-current="true"]:not(.nav-cta)::after,
.home-page .nav a:not(.nav-cta):hover::after {
  transform: scaleX(1);
}

.home-page .nav .nav-cta[aria-current="true"] {
  background: var(--coral);
}

/* Numeração das seções */
.home-page .eyebrow b {
  display: inline-block;
  margin-right: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg-soft);
  font-weight: 800;
  letter-spacing: .08em;
}

.home-page .about-title .eyebrow b {
  background: var(--yellow);
  color: var(--ink);
}

.home-page .btn > span[aria-hidden] {
  margin-left: 8px;
}

/* Hero: atalhos para a galeria já filtrada */
.home-page .hero-shortcuts {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.home-page .hero-shortcuts-label {
  display: block;
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.home-page .hero-shortcuts .hero-tags {
  margin-top: 0;
  gap: 8px;
}

.home-page .hero-tags a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid rgba(28, 33, 64, .1);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(28, 33, 64, .06);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.home-page .hero-tags a::after {
  content: "↓";
  color: var(--coral);
  transition: transform .2s ease, color .2s ease;
}

.home-page .hero-tags a:hover,
.home-page .hero-tags a:focus-visible {
  background: var(--ink);
  color: #fff;
  transform: translateY(-2px);
}

.home-page .hero-tags a:hover::after,
.home-page .hero-tags a:focus-visible::after {
  color: var(--yellow);
  transform: translateY(2px);
}

/* Link "A seguir" ao fim de cada seção */
.home-page .next-step {
  display: inline-grid;
  grid-template-columns: auto auto;
  column-gap: 16px;
  align-items: center;
  width: fit-content;
  margin-top: clamp(48px, 6vw, 72px);
  color: var(--ink);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 800;
  letter-spacing: -.02em;
}

.home-page .next-step small {
  grid-column: 1;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.home-page .next-step span {
  grid-column: 1;
}

.home-page .next-step i {
  grid-column: 2;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-style: normal;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.home-page .next-step:hover i,
.home-page .next-step:focus-visible i {
  transform: translateY(4px);
  background: var(--ink);
  color: var(--bg-soft);
}

.home-page .agency-summary .next-step {
  grid-column: 1 / -1;
  margin-top: 0;
}

/* Vídeo de agências: mesma moldura da página de agências */
.home-page .home-video {
  --frame-pad: 10px;
  --frame-radius: 40px;
  position: relative;
  justify-self: center;
  width: min(100%, 380px, calc((100svh - 220px) * 9 / 16));
  min-width: 240px;
  max-width: none;
  margin: 0;
}

.home-page .home-video-frame {
  position: relative;
  width: 100%;
  padding: var(--frame-pad);
  border-radius: var(--frame-radius);
  background: var(--ink);
  box-shadow: 0 2px 4px rgba(28, 33, 64, .12), 0 28px 60px rgba(28, 33, 64, .28);
}

.home-page .home-video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: calc(var(--frame-radius) - var(--frame-pad));
  background: #fff7ea;
  box-shadow: none;
}

.home-page .home-play {
  position: absolute;
  inset: var(--frame-pad);
  display: block;
  padding: 0;
  border: 0;
  border-radius: calc(var(--frame-radius) - var(--frame-pad));
  background: linear-gradient(180deg, rgba(28, 33, 64, 0) 35%, rgba(28, 33, 64, .5));
  color: var(--ink);
  cursor: pointer;
}

.home-page .home-play[hidden] {
  display: none;
}

.home-page .home-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 10px rgba(255, 216, 90, .28), 0 14px 30px rgba(6, 9, 28, .35);
  transition: transform .2s ease, box-shadow .2s ease;
}

.home-page .home-play-icon svg {
  display: block;
  transform: translateX(-1px);
}

.home-page .home-play-label {
  position: absolute;
  top: calc(50% + 62px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}

.home-page .home-play:hover .home-play-icon,
.home-page .home-play:focus-visible .home-play-icon {
  transform: scale(1.08);
  box-shadow: 0 0 0 16px rgba(255, 216, 90, .22), 0 14px 30px rgba(6, 9, 28, .35);
}

.home-page .home-play:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.home-page .home-play.is-loading {
  cursor: progress;
}

.home-page .home-play.is-loading .home-play-icon svg {
  display: none;
}

.home-page .home-play.is-loading .home-play-icon::after {
  content: "";
  width: 30px;
  height: 30px;
  border: 4px solid rgba(28, 33, 64, .25);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: home-spin .8s linear infinite;
}

.home-page .home-video figcaption {
  padding: 16px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

@keyframes home-spin {
  to { transform: rotate(360deg); }
}

@keyframes home-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 216, 90, .5), 0 14px 30px rgba(6, 9, 28, .35); }
  70%, 100% { box-shadow: 0 0 0 18px rgba(255, 216, 90, 0), 0 14px 30px rgba(6, 9, 28, .35); }
}

@media (prefers-reduced-motion: no-preference) {
  .home-page .home-play:not(.is-loading):not(:hover) .home-play-icon {
    animation: home-pulse 2.4s ease-out infinite;
  }
}

/* Galeria: contagem por filtro e estado vazio */
.home-page .filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.home-page .filter-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(28, 33, 64, .08);
  color: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: center;
}

.home-page .filter.active .filter-count,
.home-page .filter:hover .filter-count {
  background: rgba(255, 255, 255, .2);
}

.home-page .gallery-empty {
  margin: 24px 0 0;
  color: var(--ink-soft);
}

.home-page .gallery-empty button {
  border: 0;
  background: none;
  color: var(--coral);
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.home-page .project-grid.is-filtering .project-card:not(.hidden) {
  animation: home-card-in .45s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes home-card-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
}

/* Serviços: cada linha leva a algum lugar */
.home-page .service-row {
  position: relative;
  grid-template-columns: 70px minmax(0, 280px) 1fr auto;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.home-page .service-row:hover,
.home-page .service-row:focus-within {
  border-color: rgba(28, 33, 64, .28);
  box-shadow: 0 16px 44px rgba(28, 33, 64, .12);
}

.home-page .service-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}

/* a linha inteira é clicável; o link continua sendo o alvo real */
.home-page .service-go::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
}

.home-page .service-row:hover .service-go,
.home-page .service-go:focus-visible {
  background: var(--ink);
  color: var(--bg-soft);
}

/* Contato */
.home-page .contact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px;
  padding: 0;
  list-style: none;
}

.home-page .contact-chips li {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.home-page :is(#work, #about, #services, #contact) {
  scroll-margin-top: 84px;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .home-page .nav {
    gap: 18px;
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  .home-page .service-row {
    grid-template-columns: 60px 1fr;
  }

  .home-page .service-go {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .home-page .nav a:not(.nav-cta)::after {
    content: none;
  }

  .home-page .nav a[aria-current="true"]:not(.nav-cta) {
    color: var(--coral);
  }

  .home-page :is(#work, #about, #services, #contact) {
    scroll-margin-top: 76px;
  }

  .home-page .home-video {
    width: min(100%, 340px, calc((100svh - 220px) * 9 / 16));
  }

  .home-page .next-step {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page *,
  .home-page *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
